Comments (9)
why?
from binance.
Strange, maybe your IP is in a restricted location? E.g. binance doesn't allow any connections from IPs in the US.
I've made a small update to the example so it logs error events:
https://github.com/tiagosiebler/binance/blob/master/examples/ws-public-spot-orderbook.ts#L60-L62
Can you pull (or copy paste) the latest update and try the example again, does it print more info?
from binance.
maybe ip address problem.
any solution?
from binance.
Did you run the latest change I pushed yesterday? It should show more logs.
from binance.
seems no more logs.
subscribing to trades for: BTCUSDT
subscribing to trades for: ETHUSDT
subscribing to trades for: BNBUSDT
2024-02-03T04:52:58.930Z [ "Websocket connection closed", {
category: "binance-ws",
wsKey: "spot_depth_btcusdt_",
eventCloseCode: undefined,
wsConnectionState: 0,
isUserData: false,
listenKey: "",
market: "spot",
} ]
2024-02-03T04:52:58.932Z [ "Reconnecting to websocket with delay...", {
category: "binance-ws",
wsKey: "spot_depth_btcusdt_",
connectionDelayMs: 500,
} ]
ws automatically reconnecting.... spot_depth_btcusdt_
2024-02-03T04:52:58.946Z [ "Websocket connection closed", {
category: "binance-ws",
wsKey: "spot_depth_ethusdt_",
eventCloseCode: undefined,
wsConnectionState: 0,
isUserData: false,
listenKey: "",
market: "spot",
} ]
2024-02-03T04:52:58.947Z [ "Reconnecting to websocket with delay...", {
category: "binance-ws",
wsKey: "spot_depth_ethusdt_",
connectionDelayMs: 500,
} ]
ws automatically reconnecting.... spot_depth_ethusdt_
2024-02-03T04:52:58.952Z [ "Websocket connection closed", {
category: "binance-ws",
wsKey: "spot_depth_bnbusdt_",
eventCloseCode: undefined,
wsConnectionState: 0,
isUserData: false,
listenKey: "",
market: "spot",
} ]
2024-02-03T04:52:58.952Z [ "Reconnecting to websocket with delay...", {
category: "binance-ws",
wsKey: "spot_depth_bnbusdt_",
connectionDelayMs: 500,
} ]
ws automatically reconnecting.... spot_depth_bnbusdt_
2024-02-03T04:52:59.434Z [ "Reconnecting to public websocket", {
category: "binance-ws",
wsKey: "spot_depth_btcusdt_",
wsUrl: "wss://stream.binance.com:9443/ws/btcusdt@depth20",
} ]
2024-02-03T04:52:59.455Z [ "Reconnecting to public websocket", {
category: "binance-ws",
wsKey: "spot_depth_ethusdt_",
wsUrl: "wss://stream.binance.com:9443/ws/ethusdt@depth20",
} ]
2024-02-03T04:52:59.482Z [ "Reconnecting to public websocket", {
category: "binance-ws",
wsKey: "spot_depth_bnbusdt_",
wsUrl: "wss://stream.binance.com:9443/ws/bnbusdt@depth20",
} ]
2024-02-03T04:52:59.885Z [ "Websocket connection closed", {
category: "binance-ws",
wsKey: "spot_depth_ethusdt_",
eventCloseCode: undefined,
wsConnectionState: 4,
isUserData: false,
listenKey: "",
market: "spot",
} ]
2024-02-03T04:52:59.886Z [ "Reconnecting to websocket with delay...", {
category: "binance-ws",
wsKey: "spot_depth_ethusdt_",
connectionDelayMs: 500,
} ]
ws automatically reconnecting.... spot_depth_ethusdt_
2024-02-03T04:52:59.887Z [ "Websocket connection closed", {
category: "binance-ws",
wsKey: "spot_depth_btcusdt_",
eventCloseCode: undefined,
wsConnectionState: 4,
isUserData: false,
listenKey: "",
market: "spot",
} ]
2024-02-03T04:52:59.887Z [ "Reconnecting to websocket with delay...", {
category: "binance-ws",
wsKey: "spot_depth_btcusdt_",
connectionDelayMs: 500,
} ]
ws automatically reconnecting.... spot_depth_btcusdt_
2024-02-03T04:52:59.935Z [ "Websocket connection closed", {
category: "binance-ws",
wsKey: "spot_depth_bnbusdt_",
eventCloseCode: undefined,
wsConnectionState: 4,
isUserData: false,
listenKey: "",
market: "spot",
} ]
2024-02-03T04:52:59.935Z [ "Reconnecting to websocket with delay...", {
category: "binance-ws",
wsKey: "spot_depth_bnbusdt_",
connectionDelayMs: 500,
} ]
ws automatically reconnecting.... spot_depth_bnbusdt_
2024-02-03T04:53:00.387Z [ "Reconnecting to public websocket", {
category: "binance-ws",
wsKey: "spot_depth_ethusdt_",
wsUrl: "wss://stream.binance.com:9443/ws/ethusdt@depth20",
} ]
2024-02-03T04:53:00.417Z [ "Reconnecting to public websocket", {
category: "binance-ws",
wsKey: "spot_depth_btcusdt_",
wsUrl: "wss://stream.binance.com:9443/ws/btcusdt@depth20",
} ]
2024-02-03T04:53:00.436Z [ "Reconnecting to public websocket", {
category: "binance-ws",
wsKey: "spot_depth_bnbusdt_",
wsUrl: "wss://stream.binance.com:9443/ws/bnbusdt@depth20",
} ]
2024-02-03T04:53:00.817Z [ "Websocket connection closed", {
category: "binance-ws",
wsKey: "spot_depth_ethusdt_",
eventCloseCode: undefined,
wsConnectionState: 4,
isUserData: false,
listenKey: "",
market: "spot",
} ]
2024-02-03T04:53:00.818Z [ "Reconnecting to websocket with delay...", {
category: "binance-ws",
wsKey: "spot_depth_ethusdt_",
connectionDelayMs: 500,
} ]
ws automatically reconnecting.... spot_depth_ethusdt_
2024-02-03T04:53:00.825Z [ "Websocket connection closed", {
category: "binance-ws",
wsKey: "spot_depth_btcusdt_",
eventCloseCode: undefined,
wsConnectionState: 4,
isUserData: false,
listenKey: "",
market: "spot",
} ]
2024-02-03T04:53:00.825Z [ "Reconnecting to websocket with delay...", {
category: "binance-ws",
wsKey: "spot_depth_btcusdt_",
connectionDelayMs: 500,
} ]
ws automatically reconnecting.... spot_depth_btcusdt_
2024-02-03T04:53:00.866Z [ "Websocket connection closed", {
category: "binance-ws",
wsKey: "spot_depth_bnbusdt_",
eventCloseCode: undefined,
wsConnectionState: 4,
isUserData: false,
listenKey: "",
market: "spot",
} ]
2024-02-03T04:53:00.866Z [ "Reconnecting to websocket with delay...", {
category: "binance-ws",
wsKey: "spot_depth_bnbusdt_",
connectionDelayMs: 500,
} ]
ws automatically reconnecting.... spot_depth_bnbusdt_
2024-02-03T04:53:01.318Z [ "Reconnecting to public websocket", {
category: "binance-ws",
wsKey: "spot_depth_ethusdt_",
wsUrl: "wss://stream.binance.com:9443/ws/ethusdt@depth20",
} ]
2024-02-03T04:53:01.326Z [ "Reconnecting to public websocket", {
category: "binance-ws",
wsKey: "spot_depth_btcusdt_",
wsUrl: "wss://stream.binance.com:9443/ws/btcusdt@depth20",
} ]
2024-02-03T04:53:01.367Z [ "Reconnecting to public websocket", {
category: "binance-ws",
wsKey: "spot_depth_bnbusdt_",
wsUrl: "wss://stream.binance.com:9443/ws/bnbusdt@depth20",
} ]
from binance.
Strange, seems like a network issue for you but it's weird there's no error. Do these URLs work on the same machine?
You can test them with CURL or just in the browser, if you're doing this testing locally - just make sure it's the same machine / network connection.
from binance.
"msg": "Service unavailable from a restricted location according to 'b. Eligibility' in https://www.binance.com/en/terms. Please contact customer service if you believe you received this message in error."
from binance.
"msg": "Service unavailable from a restricted location according to 'b. Eligibility' in https://www.binance.com/en/terms. Please contact customer service if you believe you received this message in error."
Yup, this is your network. You're making requests from a country that binance has banned. This is very common for example if you're accidentally using a server in the US. Binance will block any requests from any IP in those countries, with that error.
If you think this is a mistake, you should contact binance with your IP or country.
from binance.
thank you very much
from binance.
Related Issues (20)
- misleading name for `force` parameter of `closeAll()` method
- [question] How to return the data received by websocket to the front-end project HOT 1
- missing changelog HOT 5
- Unecesarry ping when WebSocket is not ready
- Add missing simple-earn endpoints HOT 1
- Missing API endpoint for Query Commission Rates (USER_DATA) HOT 2
- Nextjs - can't resolve 'socks-proxy-agent' HOT 3
- getting "Unknown order sent" error every time I call cancelOrder HOT 4
- kucoin-api-node HOT 3
- Incorrect Type Definition for WsMessage24hrTickerFormatted HOT 2
- TypeError: Cannot create property 'newClientOrderId' on string 'BTCUSDT' HOT 1
- input params for subscribeDiffBookDepth() are not right HOT 5
- browser ping issue HOT 4
- Binance could not find order during closing request, but executed it 4 hours later HOT 4
- Error: read ECONNRESET HOT 3
- Custom URL or Endpoint HOT 5
- Request: REST Endpoints for SOR Trades HOT 1
- Cannot connect/subscribe to SpotUserDataStream on Testnet HOT 2
- User Data Streams HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from binance.