mirror of
https://github.com/fatedier/frp.git
synced 2026-01-11 22:23:12 +00:00
frpc: add support for connecting server through http proxies, see #67
This commit is contained in:
@@ -130,7 +130,11 @@ func msgSender(cli *client.ProxyClient, c *conn.Conn, msgSendChan chan interface
|
||||
}
|
||||
|
||||
func loginToServer(cli *client.ProxyClient) (c *conn.Conn, err error) {
|
||||
c, err = conn.ConnectServer(client.ServerAddr, client.ServerPort)
|
||||
if client.HttpProxy == "" {
|
||||
c, err = conn.ConnectServer(fmt.Sprintf("%s:%d", client.ServerAddr, client.ServerPort))
|
||||
} else {
|
||||
c, err = conn.ConnectServerByHttpProxy(client.HttpProxy, fmt.Sprintf("%s:%d", client.ServerAddr, client.ServerPort))
|
||||
}
|
||||
if err != nil {
|
||||
log.Error("ProxyName [%s], connect to server [%s:%d] error, %v", cli.Name, client.ServerAddr, client.ServerPort, err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user