kcp, tls and unix are transport protocols,only used with one proxy protocol,

if there are more than 2 protocols in the listen, it will cause trouble.
This commit is contained in:
zhengyu 2019-08-19 11:25:50 +08:00
parent bb105589b6
commit 6f6261edc4
3 changed files with 3 additions and 3 deletions

View File

@ -133,7 +133,7 @@ func NewKCPServer(s string, dialer proxy.Dialer) (proxy.Server, error) {
// prepare transport listener // prepare transport listener
// TODO: check here // TODO: check here
if len(transport) < 2 { if len(transport) != 2 {
return nil, errors.New("[kcp] malformd listener:" + s) return nil, errors.New("[kcp] malformd listener:" + s)
} }

View File

@ -92,7 +92,7 @@ func NewTLSServer(s string, dialer proxy.Dialer) (proxy.Server, error) {
// prepare transport listener // prepare transport listener
// TODO: check here // TODO: check here
if len(transport) < 2 { if len(transport) != 2 {
return nil, errors.New("[tls] malformd listener:" + s) return nil, errors.New("[tls] malformd listener:" + s)
} }

View File

@ -51,7 +51,7 @@ func NewUnixServer(s string, dialer proxy.Dialer) (proxy.Server, error) {
// prepare transport listener // prepare transport listener
// TODO: check here // TODO: check here
if len(transport) < 2 { if len(transport) != 2 {
return nil, errors.New("[unix] malformd listener:" + s) return nil, errors.New("[unix] malformd listener:" + s)
} }