mirror of https://github.com/cbeuw/Cloak
Allow remote host to be set in the client config file
This commit is contained in:
parent
d482661494
commit
2327420f75
|
|
@ -277,7 +277,6 @@ func main() {
|
||||||
sta := &client.State{
|
sta := &client.State{
|
||||||
LocalHost: localHost,
|
LocalHost: localHost,
|
||||||
LocalPort: localPort,
|
LocalPort: localPort,
|
||||||
RemoteHost: remoteHost,
|
|
||||||
RemotePort: remotePort,
|
RemotePort: remotePort,
|
||||||
Now: time.Now,
|
Now: time.Now,
|
||||||
}
|
}
|
||||||
|
|
@ -291,6 +290,10 @@ func main() {
|
||||||
sta.ProxyMethod = proxyMethod
|
sta.ProxyMethod = proxyMethod
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if remoteHost != "" {
|
||||||
|
sta.RemoteHost = remoteHost
|
||||||
|
}
|
||||||
|
|
||||||
if os.Getenv("SS_LOCAL_HOST") != "" {
|
if os.Getenv("SS_LOCAL_HOST") != "" {
|
||||||
sta.ProxyMethod = "shadowsocks"
|
sta.ProxyMethod = "shadowsocks"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ type rawConfig struct {
|
||||||
Transport string
|
Transport string
|
||||||
NumConn int
|
NumConn int
|
||||||
StreamTimeout int
|
StreamTimeout int
|
||||||
|
RemoteHost string
|
||||||
RemotePort int
|
RemotePort int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -128,6 +129,7 @@ func (sta *State) ParseConfig(conf string) (err error) {
|
||||||
sta.Transport = DirectTLS{}
|
sta.Transport = DirectTLS{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sta.RemoteHost = preParse.RemoteHost
|
||||||
sta.ProxyMethod = preParse.ProxyMethod
|
sta.ProxyMethod = preParse.ProxyMethod
|
||||||
sta.ServerName = preParse.ServerName
|
sta.ServerName = preParse.ServerName
|
||||||
sta.NumConn = preParse.NumConn
|
sta.NumConn = preParse.NumConn
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue