Skip to content

Socketio 2.0#6

Open
juhhov wants to merge 15 commits intoreleasefrom
socketio-2.0
Open

Socketio 2.0#6
juhhov wants to merge 15 commits intoreleasefrom
socketio-2.0

Conversation

@juhhov
Copy link
Copy Markdown

@juhhov juhhov commented Aug 2, 2018

Target is to support 1.x and 2.x socketio versions. Need to figure out how to detect which version server is running.

@juhhov juhhov requested a review from jupe August 2, 2018 10:36
@juhhov juhhov changed the base branch from merge-upstream to master August 17, 2018 07:35
except UnicodeDecodeError as error:
if self.bw_comp:
raise error

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trace would be good here

@juhhov juhhov requested a review from jonikula August 17, 2018 07:41
@juhhov juhhov changed the base branch from master to release August 20, 2018 09:39
Copy link
Copy Markdown

@jonikula jonikula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments.

@Hernrup
Copy link
Copy Markdown

Hernrup commented Nov 28, 2018

Hi, do you have any progress estimates on if and when this will get accepted? We are strugling with finding a working python client for socketio 2.x. Thanks!

@jupe
Copy link
Copy Markdown

jupe commented Nov 28, 2018

@juhhov ready for merging?

@jupe
Copy link
Copy Markdown

jupe commented Nov 28, 2018

@Hernrup have you tried this PR yet - does it work in your case? double e2e testing would be more than welcome :)

@Hernrup
Copy link
Copy Markdown

Hernrup commented Nov 28, 2018

@jupe actually no but I'll give it a try when I get to work tomorrow and let you know how it goes!

@Hernrup
Copy link
Copy Markdown

Hernrup commented Nov 29, 2018

Im sorry to say that my issues persist with the new version.
I have not ruled out that its not something in my environment but this is what im experiencing at the moment for your information and feedback.

Server

python-socketio==2.0.0

Test client

class OutboundNamespace(BaseNamespace):
    def on_connect(self):
        print('Client [Connected]')

    def on_disconnect(self):
        print('Client [Disconnected]')

    def on_event(self, event, *args):
        logger.info('client trigger event [{}]: {}'.format(event, args))


socket = outbound_socket = socketIO_client.SocketIO(
        'http://api-gateway:9999/applications/socket',
        9999, OutboundNamespace, transports=['websocket'])

socket.wait()

Result

2018-11-29 08:57:01,373 - root - DEBUG - [heartbeat connection error]
Traceback (most recent call last):
  File "/tmp/socketIO-client/socketIO_client/transports.py", line 157, in __init__
    self._connection = create_connection(ws_url, **kw)
  File "/usr/lib/python3.5/site-packages/websocket/_core.py", line 511, in create_connection
    websock.connect(url, **options)
  File "/usr/lib/python3.5/site-packages/websocket/_core.py", line 223, in connect
    self.handshake_response = handshake(self.sock, *addrs, **options)
  File "/usr/lib/python3.5/site-packages/websocket/_handshake.py", line 79, in handshake
    status, resp = _get_resp_headers(sock)
  File "/usr/lib/python3.5/site-packages/websocket/_handshake.py", line 152, in _get_resp_headers
    raise WebSocketBadStatusException("Handshake status %d %s", status, status_message)
websocket._exceptions.WebSocketBadStatusException: Handshake status 400 BAD REQUEST

It immediately falls back to 1.0 and then chooses polling as transport when handshake can not be established.

Some basic polling over GET seems to work

api-applications_1   | 2018-11-29T09:08:24.337387762+01:00 uwsgi 17 [UWSGI]: 10.98.0.4 - - [29/Nov/2018:09:08:24 +0100] "POST /applications/socket/socket.io/?t=1543478904332-1&sid=8559e0f4c90040219185c57d9e4fc432&transport=polling&EIO=3 HTTP/1.1" 400 137 "-" "python-requests/2.20.1"

But some over post fails (wrong protocal? socketIO 1.x?)

api-applications_1   | 2018-11-29T09:08:24.337387762+01:00 uwsgi 17 [UWSGI]: 10.98.0.4 - - [29/Nov/2018:09:08:24 +0100] "POST /applications/socket/socket.io/?t=1543478904332-1&sid=8559e0f4c90040219185c57d9e4fc432&transport=polling&EIO=3 HTTP/1.1" 400 137 "-" "python-requests/2.20.1"

Ill keep digging but this might provide you with some more insite. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants