the code follow:
:-----------------------------------------:
import asyncio
import websockets
import ssl
async def test_ws_quote():
#bnwsuri = ‘wss://stream.binance.com:9443/stream?streams=btcusdt@bookTicker/ethusdt@bookTicker’
bnwsuri = ‘wss://fstream.binance.com/stream?streams=btcusdt@bookTicker/ethusdt@bookTicker’
async with websockets.connect(bnwsuri,ssl=ssl.SSLContext(protocol=ssl.PROTOCOL_TLS)) as ws:
while True:
recvData = await asyncio.wait_for(ws.recv(), timeout=30)
print(recvData)
if name == “main”:
asyncio.get_event_loop().run_until_complete(test_ws_quote())
:------------------------------------------------------:
if i set bnwsuri = wss://stream.binance.com:9443/stream?streams=btcusdt@bookTicker/ethusdt@bookTicker
the code work fine,
but when i set bnwsuri = ‘wss://fstream.binance.com/stream?streams=btcusdt@bookTicker/ethusdt@bookTicker’
i can not receive any data from ws.recv( ) util timeout expection.
what is wrong?