Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 48 for remoteaddr (0.16 sec)

  1. src/net/http/httptest/httptest_test.go

    	want := &http.Request{
    		Method:     "GET",
    		Host:       "example.com",
    		URL:        &url.URL{Path: "/"},
    		Header:     http.Header{},
    		Proto:      "HTTP/1.1",
    		ProtoMajor: 1,
    		ProtoMinor: 1,
    		RemoteAddr: "192.0.2.1:1234",
    		RequestURI: "/",
    	}
    	got.Body = nil // before DeepEqual
    	want = want.WithContext(context.Background())
    	if !reflect.DeepEqual(got, want) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 11 18:09:14 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  2. pkg/util/net/ip_test.go

    	testCases := []struct {
    		name       string
    		remoteAddr string
    		expected   bool
    	}{
    		{
    			name:       "Localhost IPv4",
    			remoteAddr: "127.0.0.1:8080",
    			expected:   true,
    		},
    		{
    			name:       "Localhost IPv6",
    			remoteAddr: "[::1]:8080",
    			expected:   true,
    		},
    		{
    			name:       "Private IPv4",
    			remoteAddr: "192.168.1.100:8080",
    			expected:   false,
    		},
    		{
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 01 14:41:40 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  3. security/pkg/server/ca/authenticate/xfcc_authenticator.go

    	remoteAddr := ctx.RemoteAddress()
    	xfccHeader := ctx.Header(xfccparser.ForwardedClientCertHeader)
    	if len(remoteAddr) == 0 || len(xfccHeader) == 0 {
    		return nil, fmt.Errorf("caller from %s does not have Xfcc header", remoteAddr)
    	}
    	// First check if client is trusted client so that we can "trust" the Xfcc Header.
    	if !isTrustedAddress(remoteAddr, features.TrustedGatewayCIDR) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Apr 08 17:05:56 UTC 2024
    - 3K bytes
    - Viewed (0)
  4. src/net/http/cgi/host.go

    	}
    
    	if remoteIP, remotePort, err := net.SplitHostPort(req.RemoteAddr); err == nil {
    		env = append(env, "REMOTE_ADDR="+remoteIP, "REMOTE_HOST="+remoteIP, "REMOTE_PORT="+remotePort)
    	} else {
    		// could not parse ip:port, let's use whole RemoteAddr and leave REMOTE_PORT undefined
    		env = append(env, "REMOTE_ADDR="+req.RemoteAddr, "REMOTE_HOST="+req.RemoteAddr)
    	}
    
    	if hostDomain, _, err := net.SplitHostPort(req.Host); err == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 20:46:32 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  5. 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)
  6. 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)
  7. internal/grid/manager.go

    			fmt.Printf("grid: Got a %s request for: %v\n", req.Method, req.URL)
    		}
    		ctx := req.Context()
    		if err := m.authRequest(req); err != nil {
    			gridLogOnceIf(ctx, fmt.Errorf("auth %s: %w", req.RemoteAddr, err), req.RemoteAddr)
    			w.WriteHeader(http.StatusForbidden)
    			return
    		}
    		conn, _, _, err := ws.UpgradeHTTP(req, w)
    		if err != nil {
    			if debugPrint {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Jun 10 17:40:33 UTC 2024
    - 9.8K bytes
    - Viewed (0)
  8. pkg/util/net/ip.go

    		}
    	}
    	return
    }
    
    // IsRequestFromLocalhost returns true if request is from localhost address.
    func IsRequestFromLocalhost(r *http.Request) bool {
    	ip, _, err := net.SplitHostPort(r.RemoteAddr)
    	if err != nil {
    		return false
    	}
    
    	userIP := net.ParseIP(ip)
    	return userIP.IsLoopback()
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 01 14:41:40 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  9. src/net/unixsock_windows_test.go

    			t.Fatal(err)
    		}
    
    		if laddr == "" {
    			laddr = "@"
    		}
    		var connAddrs = [3]struct{ got, want Addr }{
    			{ln.Addr(), ta},
    			{c.LocalAddr(), &UnixAddr{Name: laddr, Net: "unix"}},
    			{c.RemoteAddr(), ta},
    		}
    		for _, ca := range connAddrs {
    			if !reflect.DeepEqual(ca.got, ca.want) {
    				t.Fatalf("got %#v, expected %#v", ca.got, ca.want)
    			}
    		}
    	}
    }
    
    func TestModeSocket(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 12 17:24:57 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  10. pilot/cmd/pilot-agent/status/server_test.go

    		name       string
    		method     string
    		remoteAddr string
    		expected   int
    	}{
    		{
    			name:       "should send a sigterm for valid requests",
    			method:     "POST",
    			remoteAddr: "127.0.0.1",
    			expected:   http.StatusOK,
    		},
    		{
    			name:       "should send a sigterm for valid ipv6 requests",
    			method:     "POST",
    			remoteAddr: "[::1]",
    			expected:   http.StatusOK,
    		},
    		{
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu May 23 15:07:03 UTC 2024
    - 42.6K bytes
    - Viewed (0)
Back to top