Websocket client question.
Posted: Wed Nov 24, 2021 10:11 pm
Hello, I'm working on a project (with an ESP32-WROOM-32 board) that needs to entablish a connection and listen to a websocket, more specifically to get realtime data from the Binance websocket (not much data, only the latest prices of two or three pairs).
I found several examples and tutorials about how to code a websocket server, but almost none examples or code on how to connect as a client (in this case to the Binance websocket) and wait/listen for data from it.
Came across to this library: https://github.com/jczic/MicroWebSrv2
which looks great and have examples to code a webserver, but due to my lack of experience in websockets I cannot realize (or understand) how to connect to a websocket (as a client) with this library...or another one.
The websocket I want to connect to is: wss://stream.binance.com:9443
API Docs: https://binance-docs.github.io/apidocs/ ... et-streams
Can someone provide some example or give me some clue on how to do what I'm trying to do?
Thanks in advance.
I found several examples and tutorials about how to code a websocket server, but almost none examples or code on how to connect as a client (in this case to the Binance websocket) and wait/listen for data from it.
Came across to this library: https://github.com/jczic/MicroWebSrv2
which looks great and have examples to code a webserver, but due to my lack of experience in websockets I cannot realize (or understand) how to connect to a websocket (as a client) with this library...or another one.
The websocket I want to connect to is: wss://stream.binance.com:9443
API Docs: https://binance-docs.github.io/apidocs/ ... et-streams
Can someone provide some example or give me some clue on how to do what I'm trying to do?
Thanks in advance.