Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 127 for remoteaddr (0.23 sec)

  1. internal/handlers/proxy.go

    		}
    	}
    
    	return addr
    }
    
    // GetSourceIPRaw retrieves the IP from the request headers
    // and falls back to r.RemoteAddr when necessary.
    // however returns without bracketing.
    func GetSourceIPRaw(r *http.Request) string {
    	addr := GetSourceIPFromHeaders(r)
    	if addr == "" {
    		addr = r.RemoteAddr
    	}
    
    	// Default to remote address if headers not set.
    	raddr, _, _ := net.SplitHostPort(addr)
    	if raddr == "" {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Dec 22 00:56:55 UTC 2023
    - 5.1K bytes
    - Viewed (0)
  2. src/net/protoconn_test.go

    	c, err := DialTCP("tcp4", nil, ra)
    	if err != nil {
    		t.Fatal(err)
    	}
    	defer c.Close()
    	c.SetKeepAlive(false)
    	c.SetKeepAlivePeriod(3 * time.Second)
    	c.SetLinger(0)
    	c.SetNoDelay(false)
    	c.LocalAddr()
    	c.RemoteAddr()
    	c.SetDeadline(time.Now().Add(someTimeout))
    	c.SetReadDeadline(time.Now().Add(someTimeout))
    	c.SetWriteDeadline(time.Now().Add(someTimeout))
    
    	if _, err := c.Write([]byte("TCPCONN TEST")); err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 18 17:20:52 UTC 2023
    - 7.4K bytes
    - Viewed (0)
  3. src/net/unixsock_linux_test.go

    	}
    
    	c2, err := DialUnix("unixgram", nil, autoAddr)
    	if err != nil {
    		t.Fatal(err)
    	}
    	defer c2.Close()
    
    	if !reflect.DeepEqual(c1.LocalAddr(), c2.RemoteAddr()) {
    		t.Fatalf("expected autobind address %v, got %v", c1.LocalAddr(), c2.RemoteAddr())
    	}
    }
    
    func TestUnixAutobindClose(t *testing.T) {
    	laddr := &UnixAddr{Name: "", Net: "unix"}
    	ln, err := ListenUnix("unix", laddr)
    	if err != nil {
    		t.Fatal(err)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 28 03:00:34 UTC 2017
    - 2.3K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/endpoints/filters/authn_audit_test.go

    		http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    			http.Error(w, "", http.StatusUnauthorized)
    		}),
    		sink, fakeRuleEvaluator)
    	req, _ := http.NewRequest("GET", "/api/v1/namespaces/default/pods", nil)
    	req.RemoteAddr = "127.0.0.1"
    	req = withTestContext(req, nil, nil)
    	req.SetBasicAuth("username", "password")
    	handler.ServeHTTP(httptest.NewRecorder(), req)
    
    	if len(sink.events) != 1 {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 12 21:42:41 UTC 2021
    - 5.5K bytes
    - Viewed (0)
  5. pkg/test/echo/server/endpoint/http.go

    	slices           int
    }
    
    func (h *httpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
    	id := uuid.New()
    	remoteAddr, _, err := net.SplitHostPort(r.RemoteAddr)
    	if err != nil {
    		epLog.Warnf("failed to get host from remote address: %s", err)
    	}
    	epLog.WithLabels("remoteAddr", remoteAddr, "method", r.Method, "url", r.URL, "host", r.Host, "headers", r.Header, "id", id).Infof("%v Request", r.Proto)
    	if h.Port == nil {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 23 16:20:31 UTC 2023
    - 12.8K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/server/filters/maxinflight_test.go

    			disableCallsWgMutex.Unlock()
    			if waitForCalls {
    				callsWg.Done()
    			}
    			t.Logf("About to blockWg.Wait(), requestURI=%v, remoteAddr=%v", r.RequestURI, r.RemoteAddr)
    			blockWg.Wait()
    			t.Logf("Returned from blockWg.Wait(), requestURI=%v, remoteAddr=%v", r.RequestURI, r.RemoteAddr)
    		}),
    		nonMutating,
    		mutating,
    		longRunningRequestCheck,
    	)
    	handler = withFakeUser(handler)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jul 26 17:14:05 UTC 2022
    - 10.2K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/util/proxy/streamtunnel_test.go

    		Port: 443,
    	}
    	tc := &tunnelingWebsocketUpgraderConn{
    		conn: &mockConn{
    			localAddr:  expectedLocalAddr,
    			remoteAddr: expectedRemoteAddr,
    		},
    	}
    	assert.Equal(t, expectedLocalAddr, tc.LocalAddr(), "LocalAddr() returns expected TCPAddr")
    	assert.Equal(t, expectedRemoteAddr, tc.RemoteAddr(), "RemoteAddr() returns expected TCPAddr")
    	// Connection nil, returns empty address
    	tc.conn = nil
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 07 02:21:50 UTC 2024
    - 22.7K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apimachinery/pkg/util/net/http.go

    	}
    	return "unknown"
    }
    
    // SourceIPs splits the comma separated X-Forwarded-For header and joins it with
    // the X-Real-Ip header and/or req.RemoteAddr, ignoring invalid IPs.
    // The X-Real-Ip is omitted if it's already present in the X-Forwarded-For chain.
    // The req.RemoteAddr is always the last IP in the returned list.
    // It returns nil if all of these are empty or invalid.
    func SourceIPs(req *http.Request) []net.IP {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Mar 05 00:08:58 UTC 2022
    - 20.8K bytes
    - Viewed (0)
  9. src/net/http/alpn_test.go

    		fmt.Fprintf(w, "path=%s,proto=", r.URL.Path)
    		if r.TLS != nil {
    			w.Write([]byte(r.TLS.NegotiatedProtocol))
    		}
    		if r.RemoteAddr == "" {
    			t.Error("request with no RemoteAddr")
    		}
    		if r.Body == nil {
    			t.Errorf("request with nil Body")
    		}
    	}))
    	ts.TLS = &tls.Config{
    		NextProtos: []string{"unhandled-proto", "tls-0.9"},
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 20 18:41:18 UTC 2020
    - 3K bytes
    - Viewed (0)
  10. src/net/http/cgi/host_test.go

    		fmt.Fprintf(rw, "basepath=%s\n", req.URL.Path)
    		fmt.Fprintf(rw, "remoteaddr=%s\n", req.RemoteAddr)
    	})
    	h := &Handler{
    		Path:                os.Args[0],
    		Root:                "/test.cgi",
    		PathLocationHandler: baseHandler,
    	}
    	expectedMap := map[string]string{
    		"basepath":   "/foo",
    		"remoteaddr": "1.2.3.4:1234",
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 18:29:59 UTC 2024
    - 13.3K bytes
    - Viewed (0)
Back to top