frpc: support connectiong frps by socks5 proxy

This commit is contained in:
fatedier
2018-05-04 18:36:38 +08:00
parent 60ecd1d58c
commit 30af32728a
5 changed files with 59 additions and 22 deletions

View File

@@ -122,10 +122,10 @@ func ConnectServer(protocol string, addr string) (c Conn, err error) {
}
}
func ConnectServerByHttpProxy(httpProxy string, protocol string, addr string) (c Conn, err error) {
func ConnectServerByProxy(proxyUrl string, protocol string, addr string) (c Conn, err error) {
switch protocol {
case "tcp":
return ConnectTcpServerByHttpProxy(httpProxy, addr)
return ConnectTcpServerByProxy(proxyUrl, addr)
case "kcp":
// http proxy is not supported for kcp
return ConnectServer(protocol, addr)