Fix: if http proxy Upgrade failure

This commit is contained in:
yaling888
2022-04-26 23:58:23 +08:00
parent ca4961a146
commit 7c50c068f5
5 changed files with 50 additions and 38 deletions

View File

@@ -62,13 +62,5 @@ func handleUDPToLocal(packet C.UDPPacket, pc net.PacketConn, key string, fAddr n
}
func handleSocket(ctx C.ConnContext, outbound net.Conn) {
tcpKeepAlive(ctx.Conn())
tcpKeepAlive(outbound)
N.Relay(ctx.Conn(), outbound)
}
func tcpKeepAlive(c net.Conn) {
if tcp, ok := c.(*net.TCPConn); ok {
tcp.SetKeepAlive(true)
}
}