You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
certifi==2024.2.2
cffi==1.16.0
curl_cffi==0.6.0b9
numpy==1.26.4
pycparser==2.21
Additional context
The text was updated successfully, but these errors were encountered: