MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / TestBuildHTTPTransportSOCKS5HProxy

Function TestBuildHTTPTransportSOCKS5HProxy

sdk/proxyutil/proxy_test.go:149–168  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

147}
148
149func TestBuildHTTPTransportSOCKS5HProxy(t *testing.T) {
150 t.Parallel()
151
152 transport, mode, errBuild := BuildHTTPTransport("socks5h://proxy.example.com:1080")
153 if errBuild != nil {
154 t.Fatalf("BuildHTTPTransport returned error: %v", errBuild)
155 }
156 if mode != ModeProxy {
157 t.Fatalf("mode = %d, want %d", mode, ModeProxy)
158 }
159 if transport == nil {
160 t.Fatal("expected transport, got nil")
161 }
162 if transport.Proxy != nil {
163 t.Fatal("expected SOCKS5H transport to bypass http proxy function")
164 }
165 if transport.DialContext == nil {
166 t.Fatal("expected SOCKS5H transport to have custom DialContext")
167 }
168}
169
170func TestBuildDialerHTTPProxyCONNECT(t *testing.T) {
171 t.Parallel()

Callers

nothing calls this directly

Calls 1

BuildHTTPTransportFunction · 0.85

Tested by

no test coverage detected