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]
|
||||
|
||||
goWeb := func() {
|
||||
_, remotePort, _ := net.SplitHostPort(conn.LocalAddr().String())
|
||||
webConn, err := net.Dial("tcp", net.JoinHostPort(sta.RedirAddr.String(), remotePort))
|
||||
redirPort := sta.RedirPort
|
||||
if redirPort == "" {
|
||||
_, redirPort, _ = net.SplitHostPort(conn.LocalAddr().String())
|
||||
}
|
||||
webConn, err := net.Dial("tcp", net.JoinHostPort(sta.RedirHost.String(), redirPort))
|
||||
if err != nil {
|
||||
log.Errorf("Making connection to redirection server: %v", err)
|
||||
return
|
||||
|
|
|
|||
Loading…
Reference in New Issue