犯罪嫌疑人X
使用上述评论中提供的信息,这里是一个关于如何通过 SOCKS 代理隧道传输 HTTP 请求的工作示例:package mainimport ( "fmt" "io/ioutil" "net" "net/http" "time" "golang.org/x/net/proxy")func main() { url := "https://example.com" socksAddress := "localhost:9998" socks, err := proxy.SOCKS5("tcp", socksAddress, nil, &net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, }) if err != nil { panic(err) } client := &http.Client{ Transport: &http.Transport{ Dial: socks.Dial, TLSHandshakeTimeout: 10 * time.Second, }, } res, err := client.Get(url) if err != nil { panic(err) } content, err := ioutil.ReadAll(res.Body) res.Body.Close() if err != nil { panic(err) } fmt.Printf("%s", string(content))}