Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ipv6fix (0.19 sec)

  1. internal/handlers/forwarder.go

    // "[fe80::d806:a55d:eb1b:49cc%vEthernet (vmxnet3 Ethernet Adapter - Virtual Switch)]:64692"
    func ipv6fix(clientIP string) string {
    	return strings.Split(clientIP, "%")[0]
    }
    
    func (rw *headerRewriter) Rewrite(req *http.Request) {
    	if clientIP, _, err := net.SplitHostPort(req.RemoteAddr); err == nil {
    		clientIP = ipv6fix(clientIP)
    		if req.Header.Get(xRealIP) == "" {
    			req.Header.Set(xRealIP, clientIP)
    		}
    	}
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Apr 07 05:42:10 GMT 2023
    - 5.6K bytes
    - Viewed (0)
Back to top