diff --git a/services/socks/socks.go b/services/socks/socks.go index 1ca388b..4845ee9 100644 --- a/services/socks/socks.go +++ b/services/socks/socks.go @@ -462,11 +462,7 @@ func (s *Socks) proxyTCP(inConn *net.Conn, serverConn *socks.ServerConn) { } func (s *Socks) GetParentConn(parentAddress string, serverConn *socks.ServerConn) (outConn net.Conn, err interface{}) { switch *s.cfg.ParentType { - case "kcp": - fallthrough - case "tls": - fallthrough - case "tcp": + case "kcp", "tls", "tcp": if *s.cfg.ParentType == "tls" { var _conn tls.Conn _conn, err = utils.TlsConnectHost(parentAddress, *s.cfg.Timeout, s.cfg.CertBytes, s.cfg.KeyBytes, s.cfg.CaCertBytes) diff --git a/services/sps/sps.go b/services/sps/sps.go index da1bad9..6693c94 100644 --- a/services/sps/sps.go +++ b/services/sps/sps.go @@ -273,11 +273,7 @@ func (s *SPS) callback(inConn net.Conn) { var err error lbAddr := "" switch *s.cfg.ParentType { - case "kcp": - fallthrough - case "tcp": - fallthrough - case "tls": + case "kcp", "tcp", "tls": lbAddr, err = s.OutToTCP(&inConn) default: err = fmt.Errorf("unkown parent type %s", *s.cfg.ParentType) diff --git a/services/tcp/tcp.go b/services/tcp/tcp.go index 4f4c792..fc11695 100644 --- a/services/tcp/tcp.go +++ b/services/tcp/tcp.go @@ -160,11 +160,7 @@ func (s *TCP) callback(inConn net.Conn) { var err error lbAddr := "" switch *s.cfg.ParentType { - case "kcp": - fallthrough - case "tcp": - fallthrough - case "tls": + case "kcp", "tcp", "tls": err = s.OutToTCP(&inConn) case "udp": s.OutToUDP(&inConn) diff --git a/services/udp/udp.go b/services/udp/udp.go index d6b32dc..787bdd6 100644 --- a/services/udp/udp.go +++ b/services/udp/udp.go @@ -141,9 +141,7 @@ func (s *UDP) callback(listener *net.UDPConn, packet []byte, localAddr, srcAddr } }() switch *s.cfg.ParentType { - case "tcp": - fallthrough - case "tls": + case "tcp", "tls": s.OutToTCP(packet, localAddr, srcAddr) case "udp": s.OutToUDP(packet, localAddr, srcAddr)