socketIO-client icon indicating copy to clipboard operation
socketIO-client copied to clipboard

transports setting not work

Open ahkimkoo opened this issue 9 years ago • 6 comments

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

ahkimkoo avatar Jan 04 '16 07:01 ahkimkoo

I too am seeing this. Any thoughts?

kyleondata avatar Sep 23 '16 16:09 kyleondata

+1

animanathome avatar Sep 28 '16 17:09 animanathome

+1

mathrb avatar Nov 23 '16 08:11 mathrb

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.

invisibleroads avatar Dec 11 '16 04:12 invisibleroads

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).

invisibleroads avatar Dec 11 '16 04:12 invisibleroads

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

nodejs_app.zip

mathrb avatar Dec 13 '16 14:12 mathrb