Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing futures websocket data stream #21

Open
vectar31 opened this issue Jun 17, 2021 · 3 comments
Open

Accessing futures websocket data stream #21

vectar31 opened this issue Jun 17, 2021 · 3 comments

Comments

@vectar31
Copy link

Currently we have access to spot data which is available at 'stream.binance.com'. Can we access futures data also which is available at fstream.binance.com? Simply changing BINANCE_WS_HOST to fstream.binance.com doesn't work. Has anyone else tried accessing futures data using binance-cxx-api?

@iamwrm
Copy link

iamwrm commented Jun 21, 2021

Yeah I have tried changing the BINANCE_WS_HOST and also the endpoint of binance::Account::startUserDataStream to https://fapi.binance.com/fapi/v1/listenKey. It still doesn't work. I could successfully get a listenKey but the ws returns nothing.

@iamwrm
Copy link

iamwrm commented Jun 22, 2021

@vectar31 Dude, change the #define BINANCE_WS_PORT from 9433 to 433 in binance_websocket.h You are welcome.

@vectar31
Copy link
Author

@iamwrm Thanks. I was able to connect to futures stream at port 443 not 433. Interestingly spot stream at stream.binance.com also works with port 443. I don't know why that happens.

Also, have you tried making multiple socket connections with this? For example, one to stream.binance.com and the other to fstream.binance.com?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants