func runHTTPProxyServer(conf Config, router socks.Router) { if conf.HTTPProxyAddr != "" { listener, err := net.Listen("tcp", conf.HTTPProxyAddr) if err != nil { return } go func() { defer listener.Close() httpProxy := socks.NewHTTPProxy(router) http.Serve(listener, httpProxy) }() } }
func runHTTPProxyServer(conf Proxy, router socks.Dialer) { if conf.HTTP != "" { listener, err := net.Listen("tcp", conf.HTTP) if err != nil { ErrLog.Println("net.Listen at ", conf.HTTP, " failed, err:", err) return } go func() { defer listener.Close() httpProxy := socks.NewHTTPProxy(router) http.Serve(listener, httpProxy) }() } }