mirror of
https://github.com/fatedier/frp.git
synced 2025-07-31 15:20:41 +07:00
refactor: refine pkg net utils (#2720)
* refactor: refine pkg net utils * fix: x Co-authored-by: blizard863 <760076784@qq.com>
This commit is contained in:
@ -234,8 +234,11 @@ func (ctl *Control) connectServer() (conn net.Conn, err error) {
|
||||
}
|
||||
}
|
||||
|
||||
address := net.JoinHostPort(ctl.clientCfg.ServerAddr, strconv.Itoa(ctl.clientCfg.ServerPort))
|
||||
conn, err = frpNet.ConnectServerByProxyWithTLS(ctl.clientCfg.HTTPProxy, ctl.clientCfg.Protocol, address, tlsConfig, ctl.clientCfg.DisableCustomTLSFirstByte)
|
||||
conn, err = frpNet.DialWithOptions(net.JoinHostPort(ctl.clientCfg.ServerAddr, strconv.Itoa(ctl.clientCfg.ServerPort)),
|
||||
frpNet.WithProxyURL(ctl.clientCfg.HTTPProxy),
|
||||
frpNet.WithProtocol(ctl.clientCfg.Protocol),
|
||||
frpNet.WithTLSConfig(tlsConfig),
|
||||
frpNet.WithDisableCustomTLSHeadByte(ctl.clientCfg.DisableCustomTLSFirstByte))
|
||||
|
||||
if err != nil {
|
||||
xl.Warn("start new connection to server error: %v", err)
|
||||
|
Reference in New Issue
Block a user