Describe the bug
Getting the following error : Failed to WS_RECV, ErrCode: 52, Reason: ''. This may be a libcurl error, See https://curl.se/libcurl/c/libcurl-errors.html first for more details.
To Reproduce
from curl_cffi.requests import Session, WebSocket
import json
msg_count = 0
def on_message(ws: WebSocket, message):
global msg_count
print("------------------------------------------------------")
print(message)
print("======================================================")
msg_count += 1
if msg_count >= 100:
ws.close()
def on_error(ws: WebSocket, error):
print(error)
def on_open(ws: WebSocket):
print("For websockets, you need to set $wss_proxy environment variable!\n"
"$https_proxy will not work!")
print(">>> Websocket open!")
def on_close(ws: WebSocket):
print("<<< Websocket closed!")
with Session() as s:
ws = s.ws_connect(
"wss://api.hardrocksportsbook.com/graphql-ws",
on_open=on_open,
on_close=on_close,
on_message=on_message,
on_error=on_error,
)
message = {"SportsbookLoginRequest": {"application": "sportsbook", "channel": "ARIZONA_ONLINE", "locale": "enus-us-x-az"}}
tosend = json.dumps(message).encode()
ws.send(tosend)
ws.run_forever()
Expected behavior
The response should be {"Response":{"status":"ok","reqId":"0"}}
Describe the bug Getting the following error :
Failed to WS_RECV, ErrCode: 52, Reason: ''. This may be a libcurl error, See https://curl.se/libcurl/c/libcurl-errors.html first for more details.
To Reproduce
Expected behavior The response should be
{"Response":{"status":"ok","reqId":"0"}}
Versions
Additional context