Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocket server dies on multiple connection attempts from same client #227

Closed
rafalsk opened this issue Jul 21, 2020 · 19 comments
Closed

Comments

@rafalsk
Copy link

rafalsk commented Jul 21, 2020

Major conclustion: The situation is worse than we thought Initially.. I thought this to be a result of trying to close the socket within the setOnConnectionCallback() method. The reality is that if we have a client constantly trying to open new sockets the server throws and dies within a few seconds.

 _onMessageCallback(
            std::make_unique<WebSocketMessage>(WebSocketMessageType::Open,
                                               "",
                                               0,
                                               WebSocketErrorInfo(),
                                               WebSocketOpenInfo(status.uri, status.headers),
                                               WebSocketCloseInfo()));

What we initially thought:
Situation: the client (Chrome) is invoking multiple socket instances. When we decide to close within setOnConnectionCallback() the server 'explodes' at the above line.

It occurs within setOnConnectionCallback() i.e. we want to limit the number of active connections from a single IP thus send error MSG and close the socket right within the onConnectionCallback

Update: I read up (by looking at an example) within documentation that stop() is used is used instead of close(), still close is a public method.What's the difference? When using stop() the result is the same.

end()/close() executes, then webSocketServer's handleConnection() kicks in, and throws at connectToSocket(), the socket param is null and timout -3.

@rafalsk rafalsk changed the title WebSocket server throws when sending data and closing socket right after, within setOnConnectionCallback WebSocket server throws when closing socket right within setOnConnectionCallback Jul 21, 2020
@marcelkauf
Copy link
Contributor

marcelkauf commented Jul 21, 2020

The server does not expect the socket to be closed after calling onConnectionCallback. You should close the socket in the onMessageCallback. We are doing this in our application without any problems.

server.setOnConnectionCallback([this](const std::shared_ptr<ix::WebSocket>& webSocket,
                                      const std::shared_ptr<ix::ConnectionState>& connectionState) {
  webSocket->setOnMessageCallback([webSocket, connectionState](const ix::WebSocketMessagePtr& msg) {
    if (msg->type == ix::WebSocketMessageType::Open) {
      if (tooManyConnections()) {
        webSocket->send(getErrorResponse());
        webSocket->close();
      }
    }
  });
});

@rafalsk
Copy link
Author

rafalsk commented Jul 21, 2020

Please do read-up on the updated version. Even if we do not do anything; (i.e. return from setOnConnectionCallback) the sever dies. Since we do Live-programming sessions it's all here: https://www.youtube.com/gridnetproject

@marcelkauf also, just referring to what you said what if a client does not send any message? Is he allowed to use up all the resources on a computer by forming new connections?

Also, here it's not the case, the server dies after less than a dozen of attempts.

@rafalsk rafalsk changed the title WebSocket server throws when closing socket right within setOnConnectionCallback WebSocket server dies on multiple connection attempts from same client Jul 21, 2020
@rafalsk
Copy link
Author

rafalsk commented Jul 21, 2020

image
As you can see on our live, the server dies after less than 20 connection attempts, now, that is serious, takes a JavaScript code running in any browser.

@rafalsk
Copy link
Author

rafalsk commented Jul 21, 2020

During the consecuritve faulty, invocation _onMessageCallback points to uninitialized memory-heap.
Besides, webSocket->_pingTimeoutSecs seems like a non-initialized value (during handleConnection() invocation)
Other socket's internal variables:
image

Anyway this should be easy to reproduce. Just create WebSockets in a loop from JavaScript in browser.

@rafalsk
Copy link
Author

rafalsk commented Jul 21, 2020

Another thing; Say Socket's events are handled by object's internal method. Now, when there's a call made to ->close() one could expect that events related to the socket would not fire anymore (since the object representing the conversation and thus encapsulating the web-socket) might had been deleted by then. So the event calls point to non-initialized memory regions. It's a separate dilemma; how to unsure than no more callbacks will be made so that the parental object can be deleted safely?

The above we've managed to solve by giving an internal grace-period after which the conversation is considered for deletion, still, the problem is worthwhile to consider.

@rafalsk
Copy link
Author

rafalsk commented Jul 22, 2020

The situation exists even if client connects to Web-Socket, closes the connection by himself and attempts to reconnect.
so all it takes to DoS is:
let mWebSocket = new WebSocket(nodeURI); sleep(2000) mWebSocket .close();
loop that in JS and the server dies at less than 20 attempts.

@rafalsk
Copy link
Author

rafalsk commented Jul 26, 2020

All in all, during testing, if there's a situation in which the C++ app is debugged in any way(execution halted) and we have the other end (WebSocket JavaScript app running in Chrome) trying to establish a couple of new connections (even if only one or two additional), the server would throw at the same lines.

WebSocketInitResult status = _ws.connectToSocket(std::move(socket), timeoutSecs);
        if (!status.success)
        {
            return status;
        }

        _onMessageCallback(
            std::make_unique<WebSocketMessage>(WebSocketMessageType::Open,
                                               "",
                                               0,
                                               WebSocketErrorInfo(),
                                               WebSocketOpenInfo(status.uri, status.headers),
                                               WebSocketCloseInfo()));

the WebSocketInitResult Status has success true http_status 200 however the _ws object has _close_reason equal to "internal error" close_code 1011. This happens every time.

is this going to be looked into into anytime soon, or are we on our own when it comes to this issue? In our case this requires restart of full-node software (minutes) after each time something goes on on the web-app's end.

@bsergean
Copy link
Collaborator

bsergean commented Jul 26, 2020 via email

@rafalsk
Copy link
Author

rafalsk commented Jul 27, 2020

@bsergean, did you at least read what I wrote and try to reproduce the error?
Does spawning a 2nd , 3rd connection come close to reaching a default conn limit equal to 128?

Even if it did I would not expect the library to throw on me and internal variables to represent errors of sort 'invalid internal state'

@bsergean
Copy link
Collaborator

bsergean commented Jul 27, 2020 via email

@bsergean
Copy link
Collaborator

5 connections attempts

@rafalsk
Copy link
Author

rafalsk commented Jul 27, 2020

We shall provide a 'working' minimal reproducable example.

@rafalsk
Copy link
Author

rafalsk commented Jul 31, 2020

image
By monday the sample should be ready, this is the major thing throwing at us during daily testing..

@rafalsk
Copy link
Author

rafalsk commented Aug 6, 2020

we'll be getting back to this soon.. sorry for delay

@rafalsk
Copy link
Author

rafalsk commented Aug 6, 2020

Please see the attachment; we've provided sample 'exploit' and exploitable server implementation.

exploitable.zip
exploit.zip

@bsergean
Copy link
Collaborator

bsergean commented Aug 6, 2020

If I use ws echo_server as the server, and open your html file in Firefox things works fine (I could see logs for more that 128 connections). I haven't looked at your C++ code yet.

Downloads$ ws echo_server --port 26039
[2020-08-06 03:46:28.034] [info] Listening on 127.0.0.1:26039
[2020-08-06 03:46:31.798] [info] New connection
[2020-08-06 03:46:31.798] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:31.798] [info] id: 0
[2020-08-06 03:46:31.798] [info] Uri: /
[2020-08-06 03:46:31.798] [info] Headers:
[2020-08-06 03:46:31.798] [info] Accept: */*
[2020-08-06 03:46:31.798] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:31.798] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:31.798] [info] Cache-Control: no-cache
[2020-08-06 03:46:31.798] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:31.798] [info] DNT: 1
[2020-08-06 03:46:31.798] [info] Host: localhost:26039
[2020-08-06 03:46:31.798] [info] Origin: null
[2020-08-06 03:46:31.798] [info] Pragma: no-cache
[2020-08-06 03:46:31.798] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:31.798] [info] Sec-WebSocket-Key: v4wrdnp/D7Y+pMEpQuoclw==
[2020-08-06 03:46:31.798] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:31.798] [info] Upgrade: websocket
[2020-08-06 03:46:31.798] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:32.798] [info] Closed connection: client id 0 code 1005 reason No status code
[2020-08-06 03:46:32.801] [info] New connection
[2020-08-06 03:46:32.801] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:32.801] [info] id: 1
[2020-08-06 03:46:32.801] [info] Uri: /
[2020-08-06 03:46:32.801] [info] Headers:
[2020-08-06 03:46:32.801] [info] Accept: */*
[2020-08-06 03:46:32.801] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:32.801] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:32.801] [info] Cache-Control: no-cache
[2020-08-06 03:46:32.801] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:32.801] [info] DNT: 1
[2020-08-06 03:46:32.801] [info] Host: localhost:26039
[2020-08-06 03:46:32.801] [info] Origin: null
[2020-08-06 03:46:32.801] [info] Pragma: no-cache
[2020-08-06 03:46:32.801] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:32.801] [info] Sec-WebSocket-Key: e4Gswq/T1RlCfviWJOvVmg==
[2020-08-06 03:46:32.801] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:32.801] [info] Upgrade: websocket
[2020-08-06 03:46:32.801] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:33.799] [info] Closed connection: client id 1 code 1005 reason No status code
[2020-08-06 03:46:33.803] [info] New connection
[2020-08-06 03:46:33.803] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:33.803] [info] id: 2
[2020-08-06 03:46:33.803] [info] Uri: /
[2020-08-06 03:46:33.803] [info] Headers:
[2020-08-06 03:46:33.803] [info] Accept: */*
[2020-08-06 03:46:33.803] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:33.803] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:33.803] [info] Cache-Control: no-cache
[2020-08-06 03:46:33.803] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:33.803] [info] DNT: 1
[2020-08-06 03:46:33.803] [info] Host: localhost:26039
[2020-08-06 03:46:33.803] [info] Origin: null
[2020-08-06 03:46:33.803] [info] Pragma: no-cache
[2020-08-06 03:46:33.803] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:33.803] [info] Sec-WebSocket-Key: bD/n5J4yw3pHC23W2nM/hg==
[2020-08-06 03:46:33.803] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:33.803] [info] Upgrade: websocket
[2020-08-06 03:46:33.803] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:34.803] [info] Closed connection: client id 2 code 1005 reason No status code
[2020-08-06 03:46:34.807] [info] New connection
[2020-08-06 03:46:34.807] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:34.807] [info] id: 3
[2020-08-06 03:46:34.807] [info] Uri: /
[2020-08-06 03:46:34.807] [info] Headers:
[2020-08-06 03:46:34.807] [info] Accept: */*
[2020-08-06 03:46:34.807] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:34.807] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:34.807] [info] Cache-Control: no-cache
[2020-08-06 03:46:34.807] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:34.807] [info] DNT: 1
[2020-08-06 03:46:34.807] [info] Host: localhost:26039
[2020-08-06 03:46:34.807] [info] Origin: null
[2020-08-06 03:46:34.807] [info] Pragma: no-cache
[2020-08-06 03:46:34.807] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:34.807] [info] Sec-WebSocket-Key: PzVoth82i6/kMXAH8Z01+w==
[2020-08-06 03:46:34.807] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:34.807] [info] Upgrade: websocket
[2020-08-06 03:46:34.807] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:35.804] [info] Closed connection: client id 3 code 1005 reason No status code
[2020-08-06 03:46:35.807] [info] New connection
[2020-08-06 03:46:35.807] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:35.807] [info] id: 4
[2020-08-06 03:46:35.807] [info] Uri: /
[2020-08-06 03:46:35.807] [info] Headers:
[2020-08-06 03:46:35.807] [info] Accept: */*
[2020-08-06 03:46:35.807] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:35.807] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:35.807] [info] Cache-Control: no-cache
[2020-08-06 03:46:35.807] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:35.807] [info] DNT: 1
[2020-08-06 03:46:35.807] [info] Host: localhost:26039
[2020-08-06 03:46:35.807] [info] Origin: null
[2020-08-06 03:46:35.807] [info] Pragma: no-cache
[2020-08-06 03:46:35.807] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:35.807] [info] Sec-WebSocket-Key: kFPpJtHJkHCIq2S86fq5hA==
[2020-08-06 03:46:35.807] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:35.807] [info] Upgrade: websocket
[2020-08-06 03:46:35.807] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:36.807] [info] Closed connection: client id 4 code 1005 reason No status code
[2020-08-06 03:46:36.811] [info] New connection
[2020-08-06 03:46:36.811] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:36.811] [info] id: 5
[2020-08-06 03:46:36.811] [info] Uri: /
[2020-08-06 03:46:36.811] [info] Headers:
[2020-08-06 03:46:36.811] [info] Accept: */*
[2020-08-06 03:46:36.811] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:36.811] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:36.811] [info] Cache-Control: no-cache
[2020-08-06 03:46:36.811] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:36.811] [info] DNT: 1
[2020-08-06 03:46:36.811] [info] Host: localhost:26039
[2020-08-06 03:46:36.811] [info] Origin: null
[2020-08-06 03:46:36.811] [info] Pragma: no-cache
[2020-08-06 03:46:36.811] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:36.811] [info] Sec-WebSocket-Key: WAvi1Vbqu8Lu5AwgYPIWMw==
[2020-08-06 03:46:36.811] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:36.811] [info] Upgrade: websocket
[2020-08-06 03:46:36.811] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:37.813] [info] Closed connection: client id 5 code 1005 reason No status code
[2020-08-06 03:46:37.817] [info] New connection
[2020-08-06 03:46:37.817] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:37.817] [info] id: 6
[2020-08-06 03:46:37.817] [info] Uri: /
[2020-08-06 03:46:37.817] [info] Headers:
[2020-08-06 03:46:37.817] [info] Accept: */*
[2020-08-06 03:46:37.817] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:37.817] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:37.817] [info] Cache-Control: no-cache
[2020-08-06 03:46:37.817] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:37.817] [info] DNT: 1
[2020-08-06 03:46:37.817] [info] Host: localhost:26039
[2020-08-06 03:46:37.817] [info] Origin: null
[2020-08-06 03:46:37.817] [info] Pragma: no-cache
[2020-08-06 03:46:37.817] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:37.817] [info] Sec-WebSocket-Key: Z7li5AporY9ZRzDOmi8X6w==
[2020-08-06 03:46:37.817] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:37.817] [info] Upgrade: websocket
[2020-08-06 03:46:37.817] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:38.814] [info] Closed connection: client id 6 code 1005 reason No status code
[2020-08-06 03:46:38.817] [info] New connection
[2020-08-06 03:46:38.818] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:38.818] [info] id: 7
[2020-08-06 03:46:38.818] [info] Uri: /
[2020-08-06 03:46:38.818] [info] Headers:
[2020-08-06 03:46:38.818] [info] Accept: */*
[2020-08-06 03:46:38.818] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:38.818] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:38.818] [info] Cache-Control: no-cache
[2020-08-06 03:46:38.818] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:38.818] [info] DNT: 1
[2020-08-06 03:46:38.818] [info] Host: localhost:26039
[2020-08-06 03:46:38.818] [info] Origin: null
[2020-08-06 03:46:38.818] [info] Pragma: no-cache
[2020-08-06 03:46:38.818] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:38.818] [info] Sec-WebSocket-Key: 4IDwZ0sVl/kw7oTBa/0l2w==
[2020-08-06 03:46:38.818] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:38.818] [info] Upgrade: websocket
[2020-08-06 03:46:38.818] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:39.819] [info] Closed connection: client id 7 code 1005 reason No status code
[2020-08-06 03:46:39.822] [info] New connection
[2020-08-06 03:46:39.822] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:39.822] [info] id: 8
[2020-08-06 03:46:39.822] [info] Uri: /
[2020-08-06 03:46:39.822] [info] Headers:
[2020-08-06 03:46:39.822] [info] Accept: */*
[2020-08-06 03:46:39.822] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:39.822] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:39.822] [info] Cache-Control: no-cache
[2020-08-06 03:46:39.822] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:39.822] [info] DNT: 1
[2020-08-06 03:46:39.822] [info] Host: localhost:26039
[2020-08-06 03:46:39.822] [info] Origin: null
[2020-08-06 03:46:39.822] [info] Pragma: no-cache
[2020-08-06 03:46:39.822] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:39.822] [info] Sec-WebSocket-Key: E6lPrtbVSLHL5LRJKCaKww==
[2020-08-06 03:46:39.822] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:39.822] [info] Upgrade: websocket
[2020-08-06 03:46:39.822] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:40.820] [info] Closed connection: client id 8 code 1005 reason No status code
[2020-08-06 03:46:40.824] [info] New connection
[2020-08-06 03:46:40.824] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:40.824] [info] id: 9
[2020-08-06 03:46:40.824] [info] Uri: /
[2020-08-06 03:46:40.824] [info] Headers:
[2020-08-06 03:46:40.824] [info] Accept: */*
[2020-08-06 03:46:40.824] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:40.824] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:40.824] [info] Cache-Control: no-cache
[2020-08-06 03:46:40.824] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:40.824] [info] DNT: 1
[2020-08-06 03:46:40.824] [info] Host: localhost:26039
[2020-08-06 03:46:40.824] [info] Origin: null
[2020-08-06 03:46:40.824] [info] Pragma: no-cache
[2020-08-06 03:46:40.824] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:40.824] [info] Sec-WebSocket-Key: /jqbsR8/MGLZHkr1vh6dHQ==
[2020-08-06 03:46:40.824] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:40.824] [info] Upgrade: websocket
[2020-08-06 03:46:40.824] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:41.822] [info] Closed connection: client id 9 code 1005 reason No status code
[2020-08-06 03:46:41.825] [info] New connection
[2020-08-06 03:46:41.825] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:41.825] [info] id: 10
[2020-08-06 03:46:41.825] [info] Uri: /
[2020-08-06 03:46:41.825] [info] Headers:
[2020-08-06 03:46:41.825] [info] Accept: */*
[2020-08-06 03:46:41.825] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:41.825] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:41.825] [info] Cache-Control: no-cache
[2020-08-06 03:46:41.825] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:41.825] [info] DNT: 1
[2020-08-06 03:46:41.825] [info] Host: localhost:26039
[2020-08-06 03:46:41.825] [info] Origin: null
[2020-08-06 03:46:41.825] [info] Pragma: no-cache
[2020-08-06 03:46:41.825] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:41.825] [info] Sec-WebSocket-Key: uES+HCtDYVLl0szqHHfVew==
[2020-08-06 03:46:41.825] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:41.825] [info] Upgrade: websocket
[2020-08-06 03:46:41.825] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:42.824] [info] Closed connection: client id 10 code 1005 reason No status code
[2020-08-06 03:46:42.827] [info] New connection
[2020-08-06 03:46:42.827] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:42.827] [info] id: 11
[2020-08-06 03:46:42.827] [info] Uri: /
[2020-08-06 03:46:42.827] [info] Headers:
[2020-08-06 03:46:42.827] [info] Accept: */*
[2020-08-06 03:46:42.827] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:42.827] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:42.827] [info] Cache-Control: no-cache
[2020-08-06 03:46:42.827] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:42.827] [info] DNT: 1
[2020-08-06 03:46:42.827] [info] Host: localhost:26039
[2020-08-06 03:46:42.827] [info] Origin: null
[2020-08-06 03:46:42.827] [info] Pragma: no-cache
[2020-08-06 03:46:42.827] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:42.827] [info] Sec-WebSocket-Key: dBf3EAQO06EKPMLBNxAW5g==
[2020-08-06 03:46:42.827] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:42.827] [info] Upgrade: websocket
[2020-08-06 03:46:42.827] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:43.826] [info] Closed connection: client id 11 code 1005 reason No status code
[2020-08-06 03:46:43.829] [info] New connection
[2020-08-06 03:46:43.829] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:43.829] [info] id: 12
[2020-08-06 03:46:43.829] [info] Uri: /
[2020-08-06 03:46:43.829] [info] Headers:
[2020-08-06 03:46:43.829] [info] Accept: */*
[2020-08-06 03:46:43.829] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:43.829] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:43.829] [info] Cache-Control: no-cache
[2020-08-06 03:46:43.829] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:43.829] [info] DNT: 1
[2020-08-06 03:46:43.829] [info] Host: localhost:26039
[2020-08-06 03:46:43.829] [info] Origin: null
[2020-08-06 03:46:43.829] [info] Pragma: no-cache
[2020-08-06 03:46:43.829] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:43.829] [info] Sec-WebSocket-Key: G7DNTF3YuYAyjEXmo0Qs6g==
[2020-08-06 03:46:43.829] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:43.829] [info] Upgrade: websocket
[2020-08-06 03:46:43.829] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:44.827] [info] Closed connection: client id 12 code 1005 reason No status code
[2020-08-06 03:46:44.831] [info] New connection
[2020-08-06 03:46:44.831] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:44.831] [info] id: 13
[2020-08-06 03:46:44.831] [info] Uri: /
[2020-08-06 03:46:44.831] [info] Headers:
[2020-08-06 03:46:44.831] [info] Accept: */*
[2020-08-06 03:46:44.831] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:44.831] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:44.831] [info] Cache-Control: no-cache
[2020-08-06 03:46:44.831] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:44.831] [info] DNT: 1
[2020-08-06 03:46:44.831] [info] Host: localhost:26039
[2020-08-06 03:46:44.831] [info] Origin: null
[2020-08-06 03:46:44.831] [info] Pragma: no-cache
[2020-08-06 03:46:44.831] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:44.831] [info] Sec-WebSocket-Key: kG8KOBm3ICfYQ+C394QdGw==
[2020-08-06 03:46:44.831] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:44.831] [info] Upgrade: websocket
[2020-08-06 03:46:44.831] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:45.833] [info] Closed connection: client id 13 code 1005 reason No status code
[2020-08-06 03:46:45.837] [info] New connection
[2020-08-06 03:46:45.837] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:45.837] [info] id: 14
[2020-08-06 03:46:45.837] [info] Uri: /
[2020-08-06 03:46:45.837] [info] Headers:
[2020-08-06 03:46:45.837] [info] Accept: */*
[2020-08-06 03:46:45.837] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:45.837] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:45.837] [info] Cache-Control: no-cache
[2020-08-06 03:46:45.837] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:45.837] [info] DNT: 1
[2020-08-06 03:46:45.837] [info] Host: localhost:26039
[2020-08-06 03:46:45.837] [info] Origin: null
[2020-08-06 03:46:45.837] [info] Pragma: no-cache
[2020-08-06 03:46:45.837] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:45.837] [info] Sec-WebSocket-Key: YcII97Bz7wG/04TN0Cy0Qw==
[2020-08-06 03:46:45.837] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:45.837] [info] Upgrade: websocket
[2020-08-06 03:46:45.837] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:46.841] [info] Closed connection: client id 14 code 1005 reason No status code
[2020-08-06 03:46:46.843] [info] New connection
[2020-08-06 03:46:46.843] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:46.843] [info] id: 15
[2020-08-06 03:46:46.843] [info] Uri: /
[2020-08-06 03:46:46.843] [info] Headers:
[2020-08-06 03:46:46.843] [info] Accept: */*
[2020-08-06 03:46:46.843] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:46.843] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:46.843] [info] Cache-Control: no-cache
[2020-08-06 03:46:46.843] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:46.843] [info] DNT: 1
[2020-08-06 03:46:46.843] [info] Host: localhost:26039
[2020-08-06 03:46:46.843] [info] Origin: null
[2020-08-06 03:46:46.843] [info] Pragma: no-cache
[2020-08-06 03:46:46.843] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:46.843] [info] Sec-WebSocket-Key: MZQqJ7Kbyt6ay3hezV8Mcg==
[2020-08-06 03:46:46.843] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:46.843] [info] Upgrade: websocket
[2020-08-06 03:46:46.843] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:47.841] [info] Closed connection: client id 15 code 1005 reason No status code
[2020-08-06 03:46:47.843] [info] New connection
[2020-08-06 03:46:47.843] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:47.843] [info] id: 16
[2020-08-06 03:46:47.843] [info] Uri: /
[2020-08-06 03:46:47.843] [info] Headers:
[2020-08-06 03:46:47.843] [info] Accept: */*
[2020-08-06 03:46:47.843] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:47.843] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:47.843] [info] Cache-Control: no-cache
[2020-08-06 03:46:47.843] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:47.843] [info] DNT: 1
[2020-08-06 03:46:47.843] [info] Host: localhost:26039
[2020-08-06 03:46:47.843] [info] Origin: null
[2020-08-06 03:46:47.843] [info] Pragma: no-cache
[2020-08-06 03:46:47.843] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:47.843] [info] Sec-WebSocket-Key: OFySUY+AYzgGEeYE2v9wRA==
[2020-08-06 03:46:47.843] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:47.843] [info] Upgrade: websocket
[2020-08-06 03:46:47.843] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:48.847] [info] Closed connection: client id 16 code 1005 reason No status code
[2020-08-06 03:46:48.849] [info] New connection
[2020-08-06 03:46:48.849] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:48.849] [info] id: 17
[2020-08-06 03:46:48.849] [info] Uri: /
[2020-08-06 03:46:48.849] [info] Headers:
[2020-08-06 03:46:48.849] [info] Accept: */*
[2020-08-06 03:46:48.849] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:48.849] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:48.849] [info] Cache-Control: no-cache
[2020-08-06 03:46:48.849] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:48.849] [info] DNT: 1
[2020-08-06 03:46:48.849] [info] Host: localhost:26039
[2020-08-06 03:46:48.849] [info] Origin: null
[2020-08-06 03:46:48.849] [info] Pragma: no-cache
[2020-08-06 03:46:48.849] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:48.849] [info] Sec-WebSocket-Key: TCXWFtcheVHmnqELHanbFA==
[2020-08-06 03:46:48.849] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:48.849] [info] Upgrade: websocket
[2020-08-06 03:46:48.849] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:49.852] [info] Closed connection: client id 17 code 1005 reason No status code
[2020-08-06 03:46:49.854] [info] New connection
[2020-08-06 03:46:49.854] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:49.854] [info] id: 18
[2020-08-06 03:46:49.854] [info] Uri: /
[2020-08-06 03:46:49.854] [info] Headers:
[2020-08-06 03:46:49.854] [info] Accept: */*
[2020-08-06 03:46:49.854] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:49.854] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:49.854] [info] Cache-Control: no-cache
[2020-08-06 03:46:49.854] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:49.854] [info] DNT: 1
[2020-08-06 03:46:49.854] [info] Host: localhost:26039
[2020-08-06 03:46:49.854] [info] Origin: null
[2020-08-06 03:46:49.854] [info] Pragma: no-cache
[2020-08-06 03:46:49.854] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:49.854] [info] Sec-WebSocket-Key: rMWByuPEx/XRWegTfaqGHQ==
[2020-08-06 03:46:49.854] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:49.854] [info] Upgrade: websocket
[2020-08-06 03:46:49.854] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:50.854] [info] Closed connection: client id 18 code 1005 reason No status code
[2020-08-06 03:46:50.857] [info] New connection
[2020-08-06 03:46:50.857] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:50.857] [info] id: 19
[2020-08-06 03:46:50.857] [info] Uri: /
[2020-08-06 03:46:50.857] [info] Headers:
[2020-08-06 03:46:50.857] [info] Accept: */*
[2020-08-06 03:46:50.857] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:50.857] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:50.857] [info] Cache-Control: no-cache
[2020-08-06 03:46:50.857] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:50.857] [info] DNT: 1
[2020-08-06 03:46:50.857] [info] Host: localhost:26039
[2020-08-06 03:46:50.857] [info] Origin: null
[2020-08-06 03:46:50.857] [info] Pragma: no-cache
[2020-08-06 03:46:50.857] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:50.857] [info] Sec-WebSocket-Key: /hWlDyea9jhHD3RkmhUu6w==
[2020-08-06 03:46:50.857] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:50.857] [info] Upgrade: websocket
[2020-08-06 03:46:50.857] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:51.856] [info] Closed connection: client id 19 code 1005 reason No status code
[2020-08-06 03:46:51.859] [info] New connection
[2020-08-06 03:46:51.859] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:51.859] [info] id: 20
[2020-08-06 03:46:51.859] [info] Uri: /
[2020-08-06 03:46:51.859] [info] Headers:
[2020-08-06 03:46:51.859] [info] Accept: */*
[2020-08-06 03:46:51.859] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:51.859] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:51.859] [info] Cache-Control: no-cache
[2020-08-06 03:46:51.859] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:51.859] [info] DNT: 1
[2020-08-06 03:46:51.859] [info] Host: localhost:26039
[2020-08-06 03:46:51.859] [info] Origin: null
[2020-08-06 03:46:51.859] [info] Pragma: no-cache
[2020-08-06 03:46:51.859] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:51.859] [info] Sec-WebSocket-Key: VVLrCGezYcrbUVim/9lcxQ==
[2020-08-06 03:46:51.859] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:51.859] [info] Upgrade: websocket
[2020-08-06 03:46:51.859] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:52.861] [info] Closed connection: client id 20 code 1005 reason No status code
[2020-08-06 03:46:52.864] [info] New connection
[2020-08-06 03:46:52.864] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:52.864] [info] id: 21
[2020-08-06 03:46:52.864] [info] Uri: /
[2020-08-06 03:46:52.864] [info] Headers:
[2020-08-06 03:46:52.864] [info] Accept: */*
[2020-08-06 03:46:52.865] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:52.865] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:52.865] [info] Cache-Control: no-cache
[2020-08-06 03:46:52.865] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:52.865] [info] DNT: 1
[2020-08-06 03:46:52.865] [info] Host: localhost:26039
[2020-08-06 03:46:52.865] [info] Origin: null
[2020-08-06 03:46:52.865] [info] Pragma: no-cache
[2020-08-06 03:46:52.865] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:52.865] [info] Sec-WebSocket-Key: 3os5B8tRI5dszg1eYIVyhw==
[2020-08-06 03:46:52.865] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:52.865] [info] Upgrade: websocket
[2020-08-06 03:46:52.865] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:53.861] [info] Closed connection: client id 21 code 1005 reason No status code
[2020-08-06 03:46:53.865] [info] New connection
[2020-08-06 03:46:53.865] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:53.865] [info] id: 22
[2020-08-06 03:46:53.865] [info] Uri: /
[2020-08-06 03:46:53.865] [info] Headers:
[2020-08-06 03:46:53.865] [info] Accept: */*
[2020-08-06 03:46:53.865] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:53.865] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:53.865] [info] Cache-Control: no-cache
[2020-08-06 03:46:53.865] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:53.865] [info] DNT: 1
[2020-08-06 03:46:53.865] [info] Host: localhost:26039
[2020-08-06 03:46:53.865] [info] Origin: null
[2020-08-06 03:46:53.865] [info] Pragma: no-cache
[2020-08-06 03:46:53.865] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:53.865] [info] Sec-WebSocket-Key: ZzCl1dSZGTCclyxJoYriVQ==
[2020-08-06 03:46:53.865] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:53.865] [info] Upgrade: websocket
[2020-08-06 03:46:53.865] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:54.866] [info] Closed connection: client id 22 code 1005 reason No status code
[2020-08-06 03:46:54.870] [info] New connection
[2020-08-06 03:46:54.870] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:54.870] [info] id: 23
[2020-08-06 03:46:54.870] [info] Uri: /
[2020-08-06 03:46:54.870] [info] Headers:
[2020-08-06 03:46:54.870] [info] Accept: */*
[2020-08-06 03:46:54.870] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:54.870] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:54.870] [info] Cache-Control: no-cache
[2020-08-06 03:46:54.870] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:54.870] [info] DNT: 1
[2020-08-06 03:46:54.870] [info] Host: localhost:26039
[2020-08-06 03:46:54.870] [info] Origin: null
[2020-08-06 03:46:54.870] [info] Pragma: no-cache
[2020-08-06 03:46:54.870] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:54.870] [info] Sec-WebSocket-Key: vOQ6u/yCpapKZItGA1xjNQ==
[2020-08-06 03:46:54.870] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:54.870] [info] Upgrade: websocket
[2020-08-06 03:46:54.870] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:55.872] [info] Closed connection: client id 23 code 1005 reason No status code
[2020-08-06 03:46:55.876] [info] New connection
[2020-08-06 03:46:55.876] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:55.876] [info] id: 24
[2020-08-06 03:46:55.876] [info] Uri: /
[2020-08-06 03:46:55.876] [info] Headers:
[2020-08-06 03:46:55.876] [info] Accept: */*
[2020-08-06 03:46:55.876] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:55.876] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:55.876] [info] Cache-Control: no-cache
[2020-08-06 03:46:55.876] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:55.876] [info] DNT: 1
[2020-08-06 03:46:55.876] [info] Host: localhost:26039
[2020-08-06 03:46:55.876] [info] Origin: null
[2020-08-06 03:46:55.876] [info] Pragma: no-cache
[2020-08-06 03:46:55.876] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:55.876] [info] Sec-WebSocket-Key: v+W8PrgNp5FDAIm9DP5r3w==
[2020-08-06 03:46:55.876] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:55.876] [info] Upgrade: websocket
[2020-08-06 03:46:55.876] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:56.873] [info] Closed connection: client id 24 code 1005 reason No status code
[2020-08-06 03:46:56.877] [info] New connection
[2020-08-06 03:46:56.877] [info] remote ip: 127.0.0.1
[2020-08-06 03:46:56.877] [info] id: 25
[2020-08-06 03:46:56.877] [info] Uri: /
[2020-08-06 03:46:56.877] [info] Headers:
[2020-08-06 03:46:56.877] [info] Accept: */*
[2020-08-06 03:46:56.877] [info] Accept-Encoding: gzip, deflate
[2020-08-06 03:46:56.877] [info] Accept-Language: en-US,en;q=0.5
[2020-08-06 03:46:56.877] [info] Cache-Control: no-cache
[2020-08-06 03:46:56.877] [info] Connection: keep-alive, Upgrade
[2020-08-06 03:46:56.877] [info] DNT: 1
[2020-08-06 03:46:56.877] [info] Host: localhost:26039
[2020-08-06 03:46:56.877] [info] Origin: null
[2020-08-06 03:46:56.877] [info] Pragma: no-cache
[2020-08-06 03:46:56.877] [info] Sec-WebSocket-Extensions: permessage-deflate
[2020-08-06 03:46:56.877] [info] Sec-WebSocket-Key: gihC6rLq7lnYakwIY+mw3g==
[2020-08-06 03:46:56.877] [info] Sec-WebSocket-Version: 13
[2020-08-06 03:46:56.877] [info] Upgrade: websocket
[2020-08-06 03:46:56.877] [info] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0
[2020-08-06 03:46:57.878] [info] Closed connection: client id 25 code 1005 reason No status code
[2020-08-06 03:46:57.881] [info] New connection

@bsergean
Copy link
Collaborator

bsergean commented Aug 6, 2020

I was able to compile your sample on macOS, with a small compile tweak so that it works with latest ixwebsocket.

I made a gist out of it.

https://gist.github.com/bsergean/08387e2e19601f7df19f74321baebb52/revisions

I can reproduce a crash but it looks like incorrect usage.

ConsoleApplication5$ clang++ --std=c++14 --stdlib=libc++ -I/usr/local/include webSockServer.cpp ConsoleApplication5.cpp -L/usr/local/lib -lixwebsocket -framework foundation -framework Security -lz
ConsoleApplication5$ ./a.out 
Server Starting up!
libc++abi.dylib: terminating with uncaught exception of type std::__1::bad_function_call: std::exception
zsh: abort      ./a.out

(ps: there is a lot of commented code in your repro, it's better if you remove it to create a minimal repro)

    mServer->setOnConnectionCallback([this, &connectionId](
        std::weak_ptr<ix::WebSocket> webSocket,
        std::shared_ptr< ix::ConnectionState> connectionState,
        std::unique_ptr<ix::ConnectionInfo> connectionInfo) {
            auto ws = webSocket.lock();
            if (ws)
            {
                ws->disableAutomaticReconnection();
                if (getConversationsByIP(connectionInfo->remoteIp).size() >= 4)
                {
                    //sendNetMsgRAW(webSocket, eNetEntType::bye, eNetReqType::notify, mTools->stringToBytes("Connection limit reached wait or try another node."));
                    //mTools->writeLine("Excessive incomming connection from IP: " + connectionInfo->remoteIp);
                    return;
                }
            }

            //std::shared_ptr<CEndPoint> ep = std::make_shared<CEndPoint>(connectionInfo->remoteIp, eEndpointType::IPv4, nullptr, connectionInfo->remotePort);
            //std::shared_ptr<CConversation> conversation = std::make_shared <CConversation>(webSocket, mBlockchainManager, mNetworkManager, ep, nullptr);


            //if (!this->registerConversation(conversation))
            //{
            //    sendNetMsgRAW(webSocket, eNetEntType::bye, eNetReqType::notify, mTools->stringToBytes("Connection limit reached wait or try another node."));
                // webSocket->send("Connection limit reached. Try another node.");
            //    return;
            //}
           // else
           // {
           //     conversation->startWebSockConversation(webSocket);
                //webSocket->sendText(std::to_string(conversation->getID()));//send session ID
                //reply with sessionID
          //  }

        });

You need to register a callback for the ws/webSocket object, as described here in the docs -> https://machinezone.github.io/IXWebSocket/usage/#websocket-server-api

@bsergean
Copy link
Collaborator

bsergean commented Aug 6, 2020

I changed the library to display a better error message when used improperly.

08387e2e19601f7df19f74321baebb52$ ./a.out
Server Starting up!
WebSocketServer Application developer error: Server callback improperly registerered.
Missing call to setOnMessageCallback inside setOnConnectionCallback.

@rafalsk
Copy link
Author

rafalsk commented Aug 7, 2020

You seem to be very fast at closing fresh issues 👍

The fact that something works with external Linux utilities does not imply that the library does not have internal issues when used through seemingly /intuitively valid invocations that are not stated to be invalid by docs. Should a fact of not registering for a callback be considered as in improper use of library is a delicate matter. I would rather say that the lib docs would need to explicitly state that registering for a given callback is a MUST.

Still, it's irrelevant here. Do you really think we have not signed up for onMessage callbacks and were not receiving data in the first place to begin with? We did.

First things first -> for a library to go wild if a callback was not registered, is at least not expected. So we've just discovered that as a side effect of the provided example. In the new API you've just briefly released (it's not part of release branch yet I can see), you seem to be checking for Null pointer, still it is not enough. What about a case when a pointer gets invalidated later on due to socket destruction since the callback function is passed simply as a reference. And we're now getting to the heart of matters..

Second, yes we did have the callback registered of course, since otherwise we wouldn't be able to receive any data in the first place and we did. It's the reproducible example which we've provided to be missing it indeed. The code might have contained comments sorry if these disturbed you.

We saw the reproducible return same error so we stopped at that and provided.

Now to the main part we were signing up for onMessageCallback within another object representing the particular conversation.

Now, the Convesation object embedding the WebSocket has an internal subroutine handling the callback. When the CConversation object got deleted it made the internal subroutine no longer pointing to a valid region in memory.

Now the main question is.. (which I suggested earlier) is the callback unregistered on socket destruction? Is it guarantied not to fire after the socket got destroyed? If not, then how does one unregister explicitly? I saw the new API; you just made available. The new API says the callback would not fire when the callback is NULL.

Questions:

  1. Regarding previous/current API we've been using. Was/is such facility in place? How is /was one to ensure the callback was not to be fired anymore. Pointer to callback function removed on socket destruction or was/is there an explicit function to achieve that?
  2. In the current just published API -> how does one un-register and thus make the pointer effectively null.

To sum up: The problem does not stem from our lack of registering for a callback but rather from the fact that the callback's pointer became invalid due to the object holding the socket being destroyed and thus invalidating pointer to the callback subroutine. The callback subroutine continued to be fired after the socket was released (we called close() on the socket before 'forgetting it'), from the viewpoint of our code (no instances) to its shared-ptr held by us. From our end everything was handled properly, socket supposedly closed, shared_ptr to WebSocket released, yet the library was still trying to execute the registered callback which belonged to a killed socket. Thus, leading to a situation which we've just stumbled upon, by providing the reproducible without a registered callback at all.

Kindly do not call this an invalid use of the library.

Additionally we suppose to be able to handle events per-socket basis (as it used to be) rather than per-global server. The 'new API' requires one to register for Messages callbacks per-server basis... wait a sec.. looking at you examples, the callback-registration routine does not take pointer to another function (the actual callback) but rather takes/provided immediate params? How are we supposed to handle events at per-connection basis? There are no connection-specific callbacks anymore?

Kindly thank you for your assistance, let's make it better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants