Keep track of clientAddr in statsChannel.

This commit is contained in:
David Fifield 2017-10-17 22:19:43 -07:00
parent 4697746120
commit 58556dc07b

View file

@ -155,7 +155,13 @@ func webSocketHandler(ws *websocket.WebSocket) {
// Pass the address of client as the remote address of incoming connection // Pass the address of client as the remote address of incoming connection
clientIPParam := ws.Request().URL.Query().Get("client_ip") clientIPParam := ws.Request().URL.Query().Get("client_ip")
or, err := pt.DialOr(&ptInfo, clientAddr(clientIPParam), ptMethodName) addr := clientAddr(clientIPParam)
if addr == "" {
statsChannel <- false
} else {
statsChannel <- true
}
or, err := pt.DialOr(&ptInfo, addr, ptMethodName)
if err != nil { if err != nil {
log.Printf("failed to connect to ORPort: %s", err) log.Printf("failed to connect to ORPort: %s", err)