socketIO-client
socketIO-client copied to clipboard
transports setting not work
transports setting not work, it still use xhr-polling.
socketIO = SocketIO('localhost', 8001, LoggingNamespace, transports=['websocket', 'xhr-polling'])
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): localhost
DEBUG:requests.packages.urllib3.connectionpool:"GET /socket.io/?EIO=3&transport=polling&t=1451894444617-0 HTTP/1.1" 200 101
I too am seeing this. Any thoughts?
+1
+1
How is the standard socket.io client handing that server? https://github.com/socketio/socket.io-client
The client will revert to xhr-polling if it is not able to upgrade to a websocket connection.
An easy way to test using the standard socket.io client is to use the browser based version. https://github.com/invisibleroads/socketIO-client/blob/master/socketIO_client/tests/index.html
You can check which transport the browser based version is using by checking the network requests for an active websocket connection or HTTP heartbeats (xhr-polling).
After testing with the js client, I think there's an issue in the python version. With the js client and my nodejs server i have a pending websocket connection, all events sent use this socket. There's also few xhr polling but it's normal because the javascript client tries first the xhr and then upgrade if does not fail. If i set the js client transport method to polling, each event sent starts a new xhr polling request. nodejs version is 6.9.2 (also fails on 4.x) socket.io is 1.7.2 (also fails on 1.6.0) express is 4.14 Using the python client, transport is always polling