修订代码;将addr的赋值从各个proxy自己的方法中提出来

This commit is contained in:
hahahrfool
2022-03-23 18:54:38 +08:00
parent b2c6abe330
commit 8c6ed6377d
9 changed files with 46 additions and 25 deletions

View File

@@ -231,13 +231,17 @@ func configCommon(ser ProxyCommon, cc *CommonConf) {
}
//setNetwork, setIsDial(true),setDialConf(dc), call configCommon
//SetAddrStr, setNetwork, setIsDial(true),setDialConf(dc), call configCommon
func configCommonForClient(cli ProxyCommon, dc *DialConf) {
cli.setNetwork(dc.Network)
cli.setIsDial(true)
cli.setDialConf(dc)
cli.setTag(dc.Tag)
if cli.Name() != "direct" {
cli.SetAddrStr(dc.GetAddrStrForListenOrDial())
}
configCommon(cli, &dc.CommonConf)
if dc.AdvancedLayer == "ws" {
@@ -245,8 +249,9 @@ func configCommonForClient(cli ProxyCommon, dc *DialConf) {
}
}
//setNetwork, setTag, setCantRoute,setListenConf(lc), call configCommon
//SetAddrStr,setNetwork, setTag, setCantRoute,setListenConf(lc), call configCommon
func configCommonForServer(ser ProxyCommon, lc *ListenConf) {
ser.SetAddrStr(lc.GetAddrStrForListenOrDial())
ser.setNetwork(lc.Network)
ser.setListenConf(lc)
ser.setTag(lc.Tag)