I am trying to run the following code from my chrome browser
import io from 'socket.io-client';
const socket = io('wss://stream.binance.com:9443');
socket.on('connect', () => {
console.log('binance [socket] Connected');
});
socket.on('disconnect', (reason) => {
console.log('binance [socket] Disconnected:', reason);
});
socket.on('error', (error) => {
console.log('binance [socket] Error:', error);
});
Why it is converting my WSS url to Https? and this problem is for this binance streaming api only I am not getting this problem when I use the following url
wss://streamer.cryptocompare.com
So, how should I overcome this problem? Thanks.
P.S. I have tried this code on both Firefox and Google Chrome both are behaving same for the Binance Websocket Api URL.