Skip to content

Unexpected response #857

@felrock

Description

@felrock

Describe the bug
Running the client/server examples inside a docker gives me an 'Unexpected response from server' error. Using Python 3.8.

To Reproduce
Steps to reproduce the behavior:
Run examples as simple_server.py and simple_client.py on the same machine, except that simple_client is in a docker env.

https://python-socketio.readthedocs.io/en/latest/intro.html#client-examples

https://python-socketio.readthedocs.io/en/latest/intro.html#server-examples

Expected behavior
Terminal print that a connection was established.

Logs
Client:
Traceback (most recent call last):
File "simple_client.py", line 18, in
sio.connect('http://127.0.0.1:5000')
File "/usr/local/lib/python3.8/dist-packages/socketio/client.py", line 338, in connect
raise exceptions.ConnectionError(exc.args[0]) from None
socketio.exceptions.ConnectionError: Unexpected response from server

Server:
(2176514) wsgi starting up on http://127.0.0.1:5000
(2176514) accepted ('127.0.0.1', 42518)
connect 8b71ba2ba70f4ec3bd0491d76fcaba22
127.0.0.1 - - [25/Jan/2022 13:15:15] "GET /socket.io/?transport=polling&EIO=4&t=1643112915.2445767 HTTP/1.1" 200 349 0.000694

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions