Feature: local socks5/http(s) auth (#216)

This commit is contained in:
bobo liu
2019-06-27 17:04:25 +08:00
committed by Dreamacro
parent 2417cfda12
commit 1c792b46c9
8 changed files with 215 additions and 19 deletions

View File

@ -7,6 +7,7 @@ import (
"github.com/Dreamacro/clash/component/socks5"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/log"
authStore "github.com/Dreamacro/clash/proxy/auth"
"github.com/Dreamacro/clash/tunnel"
)
@ -54,7 +55,7 @@ func (l *SockListener) Address() string {
}
func handleSocks(conn net.Conn) {
target, command, err := socks5.ServerHandshake(conn)
target, command, err := socks5.ServerHandshake(conn, authStore.Authenticator())
if err != nil {
conn.Close()
return