What is the Binance web socket connection URL?

Viewed 3872

var bnbWebSocketUrl = ?;
var web3 = new Web3(new Web3.providers.WebsocketProvider(bnbWebSocketUrl));

1 Answers

It's the URL of your node/provider that support WSS connections.


There is a binance.org HTTP provider mentioned in the docs, but they don't seem to support WSS.

So if you need to use WSS (and not HTTP) connection, you'll probably need to run a node, configure it so that it accepts WSS connections, and connect to this node using WSS. Or you'll need to find a provider that supports this type of connection.

But there's no "one and only / correct" WSS provider as your question suggests.

Related