0

我正在尝试连接到 Poloniex websocket 服务器wss://api2.poloniex.com以订阅每个交易对以查看订单簿和交易数据。基本上,建立连接后,我subscribe在所有交易对上运行命令:

{"command":"subscribe","channel":"BTC_REN"}
{"command":"subscribe","channel":"BTC_LOOM"}
{"command":"subscribe","channel":"USDT_GEEQ"}
{"command":"subscribe","channel":"USDT_MDT"}
{"command":"subscribe","channel":"USDT_STAKE"}
{"command":"subscribe","channel":"USDT_EOSBULL"}
{"command":"subscribe","channel":"BTC_BCHA"}
{"command":"subscribe","channel":"BTC_SAND"}
{"command":"subscribe","channel":"BTC_LINK"}
{"command":"subscribe","channel":"BTC_NEO"}
{"command":"subscribe","channel":"USDT_DICE"}
{"command":"subscribe","channel":"USDT_DOS"}
{"command":"subscribe","channel":"USDT_XTZ"}
{"command":"subscribe","channel":"TRX_SXP"}
{"command":"subscribe","channel":"USDT_DAI"}
{"command":"subscribe","channel":"TRX_JST"}
{"command":"subscribe","channel":"USDT_ETHBEAR"}
{"command":"subscribe","channel":"TUSD_BTC"}
{"command":"subscribe","channel":"USDT_BZRX"}
{"command":"subscribe","channel":"TRX_AVA"}
{"command":"subscribe","channel":"USDT_NU"}
{"command":"subscribe","channel":"USDT_REN"}
{"command":"subscribe","channel":"USDT_LSK"}
{"command":"subscribe","channel":"USDT_ROOK"}
{"command":"subscribe","channel":"USDT_SENSO"}
{"command":"subscribe","channel":"USDT_ZAP"}
{"command":"subscribe","channel":"BTC_BCH"}
{"command":"subscribe","channel":"TRX_ETH"}
{"command":"subscribe","channel":"USDC_XRP"}
{"command":"subscribe","channel":"USDT_RING"}
{"command":"subscribe","channel":"USDT_BULL"}
{"command":"subscribe","channel":"USDT_QTUM"}
{"command":"subscribe","channel":"USDT_FCT2"}
{"command":"subscribe","channel":"USDT_XMR"}
{"command":"subscribe","channel":"BTC_STPT"}
{"command":"subscribe","channel":"USDC_BCH"}
{"command":"subscribe","channel":"USDT_FARM"}
{"command":"subscribe","channel":"USDT_BRG"}
{"command":"subscribe","channel":"BTC_SC"}
{"command":"subscribe","channel":"USDT_ETC"}
{"command":"subscribe","channel":"USDT_BADGER"}
{"command":"subscribe","channel":"BTC_WRX"}
{"command":"subscribe","channel":"BTC_MANA"}
{"command":"subscribe","channel":"USDT_BCH"}
{"command":"subscribe","channel":"USDC_XMR"}
{"command":"subscribe","channel":"USDT_AKRO"}
{"command":"subscribe","channel":"BTC_FARM"}
{"command":"subscribe","channel":"USDT_BVOL"}
{"command":"subscribe","channel":"TRX_FUND"}
{"command":"subscribe","channel":"BTC_SENSO"}
{"command":"subscribe","channel":"USDC_ETC"}
{"command":"subscribe","channel":"USDT_ETHBULL"}
{"command":"subscribe","channel":"BTC_BCHSV"}
{"command":"subscribe","channel":"DAI_ETH"}
{"command":"subscribe","channel":"BTC_LTC"}
{"command":"subscribe","channel":"USDT_SWRV"}
{"command":"subscribe","channel":"USDT_DEC"}
{"command":"subscribe","channel":"TRX_XRP"}
{"command":"subscribe","channel":"USDT_FRONT"}
{"command":"subscribe","channel":"USDT_TRX"}
{"command":"subscribe","channel":"BTC_HGET"}
{"command":"subscribe","channel":"BTC_GAS"}
{"command":"subscribe","channel":"USDT_LRC"}
{"command":"subscribe","channel":"USDC_TUSD"}
{"command":"subscribe","channel":"BTC_KNC"}
{"command":"subscribe","channel":"BTC_QTUM"}
{"command":"subscribe","channel":"USDT_REEF"}
{"command":"subscribe","channel":"USDT_SAND"}
{"command":"subscribe","channel":"USDT_BEAR"}
{"command":"subscribe","channel":"USDT_SUN"}
{"command":"subscribe","channel":"USDT_REPV2"}
{"command":"subscribe","channel":"BTC_BID"}
{"command":"subscribe","channel":"USDT_CVT"}
{"command":"subscribe","channel":"USDT_ADD"}
{"command":"subscribe","channel":"BTC_DASH"}
{"command":"subscribe","channel":"USDC_DASH"}
{"command":"subscribe","channel":"BUSD_BTC"}
{"command":"subscribe","channel":"ETH_ETC"}
{"command":"subscribe","channel":"USDT_BOND"}
{"command":"subscribe","channel":"USDT_API3"}
{"command":"subscribe","channel":"BTC_MKR"}
{"command":"subscribe","channel":"USDT_BAC"}
{"command":"subscribe","channel":"USDT_ZRX"}
{"command":"subscribe","channel":"USDT_YFI"}
{"command":"subscribe","channel":"USDT_WRX"}
{"command":"subscribe","channel":"USDT_SWFTC"}
{"command":"subscribe","channel":"USDT_SC"}
{"command":"subscribe","channel":"PAX_BTC"}
{"command":"subscribe","channel":"TRX_MDT"}
{"command":"subscribe","channel":"USDT_HGET"}
{"command":"subscribe","channel":"USDT_BCHC"}
{"command":"subscribe","channel":"TRX_LINK"}
{"command":"subscribe","channel":"USDT_CUSDT"}
{"command":"subscribe","channel":"USDT_FIL"}
{"command":"subscribe","channel":"BTC_MATIC"}
{"command":"subscribe","channel":"USDT_RSR"}
{"command":"subscribe","channel":"BTC_STEEM"}
{"command":"subscribe","channel":"BTC_BAT"}
{"command":"subscribe","channel":"BTC_SXP"}
{"command":"subscribe","channel":"USDC_DOGE"}
{"command":"subscribe","channel":"USDT_AMP"}
{"command":"subscribe","channel":"BTC_POLY"}
{"command":"subscribe","channel":"USDT_AAVE"}
{"command":"subscribe","channel":"BTC_SWINGBY"}
{"command":"subscribe","channel":"BTC_NXT"}
{"command":"subscribe","channel":"USDT_PAX"}
{"command":"subscribe","channel":"BTC_ETH"}
{"command":"subscribe","channel":"BTC_AKRO"}
{"command":"subscribe","channel":"USDT_LON"}
{"command":"subscribe","channel":"USDT_ADABEAR"}
{"command":"subscribe","channel":"USDT_TRB"}
{"command":"subscribe","channel":"USDT_CUDOS"}
{"command":"subscribe","channel":"USDT_MATIC"}
{"command":"subscribe","channel":"BUSD_BNB"}
{"command":"subscribe","channel":"USDT_DOGE"}
{"command":"subscribe","channel":"USDT_YFII"}
{"command":"subscribe","channel":"BTC_LSK"}
{"command":"subscribe","channel":"USDT_LINKBULL"}
{"command":"subscribe","channel":"USDT_EOSBEAR"}
{"command":"subscribe","channel":"BTC_INJ"}
{"command":"subscribe","channel":"USDT_UMA"}
{"command":"subscribe","channel":"USDT_DEXT"}
{"command":"subscribe","channel":"USDT_FTT"}
{"command":"subscribe","channel":"USDT_ESD"}
{"command":"subscribe","channel":"BTC_FOAM"}
{"command":"subscribe","channel":"BTC_TRU"}
{"command":"subscribe","channel":"USDT_ZLOT"}
{"command":"subscribe","channel":"USDT_XRP"}
{"command":"subscribe","channel":"BTC_EOS"}
{"command":"subscribe","channel":"USDT_LPT"}
{"command":"subscribe","channel":"USDC_ATOM"}
{"command":"subscribe","channel":"BTC_ZRX"}
{"command":"subscribe","channel":"USDT_LIVE"}
{"command":"subscribe","channel":"USDT_BNB"}
{"command":"subscribe","channel":"ETH_ZEC"}
{"command":"subscribe","channel":"BTC_XEM"}
{"command":"subscribe","channel":"USDT_TAI"}
{"command":"subscribe","channel":"USDT_PRQ"}
{"command":"subscribe","channel":"TUSD_ETH"}
{"command":"subscribe","channel":"BTC_AMP"}
{"command":"subscribe","channel":"USDT_PERX"}
{"command":"subscribe","channel":"BTC_STR"}
{"command":"subscribe","channel":"USDT_ONEINCH"}
{"command":"subscribe","channel":"BTC_OMG"}
{"command":"subscribe","channel":"USDT_BAND"}
{"command":"subscribe","channel":"USDT_CRV"}
{"command":"subscribe","channel":"USDT_BCHSV"}
{"command":"subscribe","channel":"USDT_XFLR"}
{"command":"subscribe","channel":"TRX_BTT"}
{"command":"subscribe","channel":"USDT_TRXBEAR"}
{"command":"subscribe","channel":"USDT_SNX"}
{"command":"subscribe","channel":"BTC_DOGE"}
{"command":"subscribe","channel":"USDT_SFI"}
{"command":"subscribe","channel":"TRX_BNB"}
{"command":"subscribe","channel":"USDT_WBTC"}
{"command":"subscribe","channel":"USDT_INJ"}
{"command":"subscribe","channel":"USDC_BCHSV"}
{"command":"subscribe","channel":"USDT_SWAP"}
{"command":"subscribe","channel":"USDT_NEO"}
{"command":"subscribe","channel":"USDT_ATOM"}
{"command":"subscribe","channel":"USDT_BAT"}
{"command":"subscribe","channel":"USDT_USDJ"}
{"command":"subscribe","channel":"USDT_FUND"}
{"command":"subscribe","channel":"USDT_BID"}
{"command":"subscribe","channel":"USDT_ADABULL"}
{"command":"subscribe","channel":"USDT_MANA"}
{"command":"subscribe","channel":"USDC_EOS"}
{"command":"subscribe","channel":"BTC_DCR"}
{"command":"subscribe","channel":"TRX_MATIC"}
{"command":"subscribe","channel":"USDT_DOT"}
{"command":"subscribe","channel":"USDT_XLMBEAR"}
{"command":"subscribe","channel":"USDT_XRPBULL"}
{"command":"subscribe","channel":"USDT_BSVBULL"}
{"command":"subscribe","channel":"USDT_TRXBULL"}
{"command":"subscribe","channel":"BTC_CVT"}
{"command":"subscribe","channel":"USDT_EOS"}
{"command":"subscribe","channel":"ETH_EOS"}
{"command":"subscribe","channel":"BTC_REPV2"}
{"command":"subscribe","channel":"BTC_TRX"}
{"command":"subscribe","channel":"USDT_GRT"}
{"command":"subscribe","channel":"USDT_VALUE"}
{"command":"subscribe","channel":"USDT_TEND"}
{"command":"subscribe","channel":"USDT_STEEM"}
{"command":"subscribe","channel":"BTC_DOT"}
{"command":"subscribe","channel":"BTC_ZEC"}
{"command":"subscribe","channel":"USDT_POLS"}
{"command":"subscribe","channel":"USDT_TRADE"}
{"command":"subscribe","channel":"USDT_OM"}
{"command":"subscribe","channel":"BTC_GLM"}
{"command":"subscribe","channel":"USDT_RFUEL"}
{"command":"subscribe","channel":"USDC_LTC"}
{"command":"subscribe","channel":"USDC_BTC"}
{"command":"subscribe","channel":"TRX_WIN"}
{"command":"subscribe","channel":"USDT_ETH"}
{"command":"subscribe","channel":"USDT_AVA"}
{"command":"subscribe","channel":"USDT_FSW"}
{"command":"subscribe","channel":"BTC_FCT2"}
{"command":"subscribe","channel":"USDT_BCHA"}
{"command":"subscribe","channel":"PAX_ETH"}
{"command":"subscribe","channel":"BTC_XMR"}
{"command":"subscribe","channel":"USDT_BCN"}
{"command":"subscribe","channel":"USDT_BTC"}
{"command":"subscribe","channel":"BTC_CHR"}
{"command":"subscribe","channel":"BTC_BNT"}
{"command":"subscribe","channel":"BTC_XTZ"}
{"command":"subscribe","channel":"USDT_OCEAN"}
{"command":"subscribe","channel":"USDT_BCHBEAR"}
{"command":"subscribe","channel":"USDT_XLMBULL"}
{"command":"subscribe","channel":"USDT_BUSD"}
{"command":"subscribe","channel":"BTC_AVA"}
{"command":"subscribe","channel":"USDJ_BTC"}
{"command":"subscribe","channel":"BTC_SWAP"}
{"command":"subscribe","channel":"USDT_CVP"}
{"command":"subscribe","channel":"USDT_MCB"}
{"command":"subscribe","channel":"USDT_YFL"}
{"command":"subscribe","channel":"USDT_CORN"}
{"command":"subscribe","channel":"USDT_PEARL"}
{"command":"subscribe","channel":"USDT_BSVBEAR"}
{"command":"subscribe","channel":"USDT_BAL"}
{"command":"subscribe","channel":"USDT_MPH"}
{"command":"subscribe","channel":"ETH_COMP"}
{"command":"subscribe","channel":"USDT_COMP"}
{"command":"subscribe","channel":"USDT_CREAM"}
{"command":"subscribe","channel":"USDT_TRU"}
{"command":"subscribe","channel":"BTC_ATOM"}
{"command":"subscribe","channel":"BTC_SNX"}
{"command":"subscribe","channel":"BTC_ARDR"}
{"command":"subscribe","channel":"USDT_COMBO"}
{"command":"subscribe","channel":"BTC_ETC"}
{"command":"subscribe","channel":"BTC_SWFTC"}
{"command":"subscribe","channel":"USDT_GHST"}
{"command":"subscribe","channel":"USDT_DASH"}
{"command":"subscribe","channel":"BTC_AAVE"}
{"command":"subscribe","channel":"USDT_LINKBEAR"}
{"command":"subscribe","channel":"USDT_VSP"}
{"command":"subscribe","channel":"USDT_DIA"}
{"command":"subscribe","channel":"USDT_HEGIC"}
{"command":"subscribe","channel":"USDT_ALPHA"}
{"command":"subscribe","channel":"USDT_RARI"}
{"command":"subscribe","channel":"USDT_SHIB"}
{"command":"subscribe","channel":"USDT_TUSD"}
{"command":"subscribe","channel":"TRX_BRG"}
{"command":"subscribe","channel":"USDT_BCHBULL"}
{"command":"subscribe","channel":"USDT_BLY"}
{"command":"subscribe","channel":"USDT_GLM"}
{"command":"subscribe","channel":"BTC_FIL"}
{"command":"subscribe","channel":"ETH_ZRX"}
{"command":"subscribe","channel":"USDC_USDT"}
{"command":"subscribe","channel":"USDT_SRM"}
{"command":"subscribe","channel":"USDT_BDP"}
{"command":"subscribe","channel":"TRX_NEO"}
{"command":"subscribe","channel":"USDT_UNI"}
{"command":"subscribe","channel":"USDT_LTCBEAR"}
{"command":"subscribe","channel":"USDJ_TRX"}
{"command":"subscribe","channel":"USDT_EXE"}
{"command":"subscribe","channel":"USDC_TRX"}
{"command":"subscribe","channel":"BTC_STORJ"}
{"command":"subscribe","channel":"BTC_WBTC"}
{"command":"subscribe","channel":"USDT_JST"}
{"command":"subscribe","channel":"TRX_AMP"}
{"command":"subscribe","channel":"BTC_LPT"}
{"command":"subscribe","channel":"DAI_BTC"}
{"command":"subscribe","channel":"USDT_TORN"}
{"command":"subscribe","channel":"USDT_STPT"}
{"command":"subscribe","channel":"USDT_SWINGBY"}
{"command":"subscribe","channel":"BNB_BTC"}
{"command":"subscribe","channel":"TRX_XTZ"}
{"command":"subscribe","channel":"TRX_WRX"}
{"command":"subscribe","channel":"USDT_ZKS"}
{"command":"subscribe","channel":"USDT_BTCST"}
{"command":"subscribe","channel":"USDC_STR"}
{"command":"subscribe","channel":"USDT_WNXM"}
{"command":"subscribe","channel":"TRX_STEEM"}
{"command":"subscribe","channel":"BTC_SNT"}
{"command":"subscribe","channel":"USDC_ETH"}
{"command":"subscribe","channel":"USDT_BTT"}
{"command":"subscribe","channel":"BTC_EXE"}
{"command":"subscribe","channel":"USDT_MEME"}
{"command":"subscribe","channel":"USDT_ZEC"}
{"command":"subscribe","channel":"USDT_XRPBEAR"}
{"command":"subscribe","channel":"USDT_AKITA"}
{"command":"subscribe","channel":"USDT_CHR"}
{"command":"subscribe","channel":"BTC_CVC"}
{"command":"subscribe","channel":"USDT_SUSHI"}
{"command":"subscribe","channel":"BTC_FUND"}
{"command":"subscribe","channel":"USDT_LTCBULL"}
{"command":"subscribe","channel":"TRX_DICE"}
{"command":"subscribe","channel":"TRX_SWFTC"}
{"command":"subscribe","channel":"USDT_MKR"}
{"command":"subscribe","channel":"USDT_LTC"}
{"command":"subscribe","channel":"USDJ_BTT"}
{"command":"subscribe","channel":"BTC_FRONT"}
{"command":"subscribe","channel":"USDT_KP3R"}
{"command":"subscribe","channel":"USDT_KTON"}
{"command":"subscribe","channel":"USDT_LINK"}
{"command":"subscribe","channel":"BTC_LRC"}
{"command":"subscribe","channel":"TRX_CHR"}
{"command":"subscribe","channel":"USDT_MTA"}
{"command":"subscribe","channel":"BTC_NMR"}
{"command":"subscribe","channel":"BTC_XRP"}
{"command":"subscribe","channel":"USDT_STR"}
{"command":"subscribe","channel":"USDT_WIN"}
{"command":"subscribe","channel":"USDT_SXP"}
{"command":"subscribe","channel":"USDC_ZEC"}
{"command":"subscribe","channel":"BTC_BTS"}
{"command":"subscribe","channel":"BTC_MDT"}

但是大约 10 分钟后,我总是断开连接Connection closed to the remote host wss://api2.poloniex.com with code 1006. Reason: Unexpected end of stream。我正在使用wscat https://github.com/websockets/wscat websocket 库。

任何建议将不胜感激。

谢谢

4

0 回答 0