我想连接此网络套接字URL wss://kline.bw.com/websocket,当我使用websocket-client
时,它正常工作
from websocket import create_connection
con = create_connection('wss://kline.bw.com/websocket')
con.send('{"dataType":"281_ENTRUST_ADD_BTC_USDT","dataSize":50,"action":"ADD"}')
data = con.recv()
但是当我使用aiohttp连接此websocket时,它会引发WSServerHandshakeError
async with aiohttp.ClientSession() as session:
async with session.ws_connect("wss://kline.BW.com/websocket", ssl=False) as ws:
await ws.send('{"dataType":"281_ENTRUST_ADD_BTC_USDT","dataSize":50,"action":"ADD"}')、
async for msg in ws:
print(msg)
以及如何解决此错误?