GithubHelp home page GithubHelp logo

Comments (9)

guotie avatar guotie commented on June 14, 2024

why?

from binance.

tiagosiebler avatar tiagosiebler commented on June 14, 2024

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.

guotie avatar guotie commented on June 14, 2024

maybe ip address problem.

any solution?

from binance.

tiagosiebler avatar tiagosiebler commented on June 14, 2024

Did you run the latest change I pushed yesterday? It should show more logs.

from binance.

guotie avatar guotie commented on June 14, 2024

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.

tiagosiebler avatar tiagosiebler commented on June 14, 2024

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.

guotie avatar guotie commented on June 14, 2024

"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.

tiagosiebler avatar tiagosiebler commented on June 14, 2024

"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.

guotie avatar guotie commented on June 14, 2024

thank you very much

from binance.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.