(downstreamConn net.Conn, host string, resp []byte)
| 326 | } |
| 327 | |
| 328 | func (proxy *ProxyClient) dialHostAndBridge(downstreamConn net.Conn, host string, resp []byte) { |
| 329 | targetSiteConn, err := net.Dial("tcp", host) |
| 330 | if err != nil { |
| 331 | proxy.Logger.E("Dial", "Error", err) |
| 332 | downstreamConn.Close() |
| 333 | return |
| 334 | } |
| 335 | |
| 336 | downstreamConn.Write(resp) |
| 337 | go proxy.Cipher.IO.Bridge(downstreamConn, targetSiteConn, nil, IOConfig{}) |
| 338 | } |
| 339 | |
| 340 | func (proxy *ProxyClient) ServeHTTP(w http.ResponseWriter, r *http.Request) { |
| 341 | if proxy.UserAuth != "" { |
no test coverage detected