Skip to content

Is socketIO-client-2 v0.7.5 compatible with socket.io v2.0.3 #10

@alphara

Description

@alphara

I'm using socketIO-client-2 v0.7.5 and socket.io v2.0.3. On my machine, those versions doesn't work together.

Are those versions compatible?

socketIO-client-2 v0.7.5 is working good with old version socket.io v1.4.8.

I found that modules are supporting different versions of protocols.

Please note that this version implements socket.io protocol 1.x
https://pypi.python.org/pypi/socketIO-client-2/0.7.5

Current protocol revision: 4
https://github.com/socketio/socket.io-protocol

I'm getting the following stack trace with latest versions:

Traceback (most recent call last):
  File "/Users/artemarakcheev/anaconda/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/Users/artemarakcheev/anaconda/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "loadTest.py", line 140, in rtWorker
    socketIO = setupStream(asrUrl, clientKey, clientSecret)
  File "loadTest.py", line 130, in setupStream
    headers={'Authorization': 'Bearer ' + bearerToken})
  File "/Users/artemarakcheev/anaconda/lib/python3.6/site-packages/socketIO_client/__init__.py", line 345, in __init__
    resource, hurry_interval_in_seconds, **kw)
  File "/Users/artemarakcheev/anaconda/lib/python3.6/site-packages/socketIO_client/__init__.py", line 58, in __init__
    self._transport
  File "/Users/artemarakcheev/anaconda/lib/python3.6/site-packages/socketIO_client/__init__.py", line 66, in _transport
    self._engineIO_session = self._get_engineIO_session()
  File "/Users/artemarakcheev/anaconda/lib/python3.6/site-packages/socketIO_client/__init__.py", line 80, in _get_engineIO_session
    transport.recv_packet())
  File "/Users/artemarakcheev/anaconda/lib/python3.6/site-packages/socketIO_client/transports.py", line 92, in recv_packet
    for engineIO_packet in decode_engineIO_content(response.content):
  File "/Users/artemarakcheev/anaconda/lib/python3.6/site-packages/socketIO_client/parsers.py", line 95, in decode_engineIO_content
    content, content_index)
  File "/Users/artemarakcheev/anaconda/lib/python3.6/site-packages/socketIO_client/parsers.py", line 202, in _read_packet_length
    while get_byte(content, content_index) not in [0, 1]:
  File "/Users/artemarakcheev/anaconda/lib/python3.6/site-packages/socketIO_client/symmetries.py", line 36, in get_byte
    return six.indexbytes(x, index)
IndexError: index out of range

This is snippet with connection thru socketIO-client-2

from socketIO_client import SocketIO
...
        socketIO = SocketIO(
            asrUrl,
            verify=False,
            transports=['websocket'],
            headers={'Authorization': 'Bearer ' + bearerToken})

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