mirror of https://github.com/cbeuw/Cloak
Update goWeb with new state fields
This commit is contained in:
parent
65553f4ec4
commit
2acc174a05
|
|
@ -40,8 +40,11 @@ func dispatchConnection(conn net.Conn, sta *server.State) {
|
||||||
data := buf[:i]
|
data := buf[:i]
|
||||||
|
|
||||||
goWeb := func() {
|
goWeb := func() {
|
||||||
_, remotePort, _ := net.SplitHostPort(conn.LocalAddr().String())
|
redirPort := sta.RedirPort
|
||||||
webConn, err := net.Dial("tcp", net.JoinHostPort(sta.RedirAddr.String(), remotePort))
|
if redirPort == "" {
|
||||||
|
_, redirPort, _ = net.SplitHostPort(conn.LocalAddr().String())
|
||||||
|
}
|
||||||
|
webConn, err := net.Dial("tcp", net.JoinHostPort(sta.RedirHost.String(), redirPort))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("Making connection to redirection server: %v", err)
|
log.Errorf("Making connection to redirection server: %v", err)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue