1

I want to build my own library to be used for server -> browser communicating via websockets. I have tried to build something, it's here: https://github.com/duverse/wsc. But sometimes, when I trying to make API Call to my own server, I've got something like this:

Python requests

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/project/.venv/local/lib/python2.7/site-packages/wsc/client/__init__.py", line 109, in stat
    'Access-Key': self._access_key
  File "/project/.venv/local/lib/python2.7/site-packages/requests/api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "/project/.venv/local/lib/python2.7/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/project/.venv/local/lib/python2.7/site-packages/requests/sessions.py", line 502, in request
    resp = self.send(prep, **send_kwargs)
  File "/project/.venv/local/lib/python2.7/site-packages/requests/sessions.py", line 612, in send
    r = adapter.send(request, **kwargs)
  File "/project/.venv/local/lib/python2.7/site-packages/requests/adapters.py", line 490, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', error(104, 'Connection reset by peer'))

I think that problem is in this method: https://github.com/duverse/wsc/blob/master/wsc/server/request.py#L113, because all websocket connections works fine. Usually it's probably tries to receive package that is empty. I am not sure.

P.S. I have used SSLSocket, and packages from the websocket request is always splited. At the first time it always sends me only one byte, and then all other.

P.P.S. WSC Server log has just it:

WSC.log

----------------------------------------
Exception happened during processing of request from ('123.123.123.123', 45757)
----------------------------------------

Without trace. (ip was replaced)

0 Answers0