mirror of https://github.com/cbeuw/Cloak
Fix a missing IPv6 bracket
This commit is contained in:
parent
2af372254f
commit
ebd7e6b1bd
|
|
@ -167,7 +167,12 @@ func dispatchConnection(conn net.Conn, sta *server.State) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ssConn, err := net.Dial("tcp", sta.SS_LOCAL_HOST+":"+sta.SS_LOCAL_PORT)
|
ssIP := sta.SS_LOCAL_HOST
|
||||||
|
if net.ParseIP(ssIP).To4() == nil {
|
||||||
|
// IPv6 needs square brackets
|
||||||
|
ssIP = "[" + ssIP + "]"
|
||||||
|
}
|
||||||
|
ssConn, err := net.Dial("tcp", ssIP+":"+sta.SS_LOCAL_PORT)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Failed to connect to ssserver: %v\n", err)
|
log.Printf("Failed to connect to ssserver: %v\n", err)
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue