invisibleroads / invisibleroads/socketIO-client
Can't connect to socket.io server: unexpected status code 404
- Dominant language
- Python
- Stars
- 441
- Forks
- 204
- PR merge metrics
- No merged PRs in 30d
Description
First off, thanks for writing this python library; it's a life-saver for my project.
I'm trying to connect to the [IEX websocket server](https://www.iextrading.com/developer/docs/#tops) using this library with the example code (slightly modified):
```
from socketIO_client import SocketIO, BaseNamespace
import logging
logging.getLogger('socketIO-client').setLevel(logging.DEBUG)
logging.basicConfig()
from socketIO_client import SocketIO, LoggingNamespace
def on_connect():
socketIO.emit('subscribe','snap')
def on_disconnect():
print('disconnect')
def on_reconnect():
print('reconnect')
socketIO = SocketIO('https://ws-api.iextrading.com/1.0', Namespace=LoggingNamespace, wait_for_connection=True, resource='last')
socketIO.on('connect', on_connect)
socketIO.on('disconnect', on_disconnect)
socketIO.on('reconnect', on_reconnect)
```
However every time I run this, I run into the following error:
```
WARNING:socketIO-client:ws-api.iextrading.com:443/1.0/tops [engine.io waiting for connection] unexpected status code (404
)
```
The URL works fine on the javascript client:
```
const url = 'https://ws-api.iextrading.com:443/1.0/tops'
const socket = require('socket.io-client')(url)
socket.on('connect', () => {
socket.emit('subscribe', 'snap')
})
```
How can I fix this issue? Does it have something to do with the commented out HTML?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.