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
"""WIP: this has not been implemented yet."""importasynciofromcurl_cffiimportrequestsasyncdefon_message(ws, message):
print(message)
asyncdefon_error(ws, error):
print(error)
asyncdefon_open(ws):
print("For websockets, you need to set $wss_proxy environment variable!\n""$https_proxy will not work!")
print(">>> Websocket open!")
asyncdefon_close(ws):
print("<<< Websocket closed!")
asyncdefmain():
asyncwithrequests.AsyncSession() ass:
ws=awaits.ws_connect(
"wss://api.gemini.com/v1/marketdata/BTCUSD",
on_open=on_open,
on_close=on_close,
on_message=on_message,
on_error=on_error,
)
ws.run_forever()
asyncio.run(main())
Terminal error
Traceback (most recent call last):
File "/Users/baobao/MyDesktop/python/func-proxy/test.py", line 38, in<module>asyncio.run(main())
File "/opt/homebrew/Cellar/python@3.10/3.10.13_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/opt/homebrew/Cellar/python@3.10/3.10.13_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
returnfuture.result()
File "/Users/baobao/MyDesktop/python/func-proxy/test.py", line 28, in main
ws = await s.ws_connect(
File "/opt/homebrew/lib/python3.10/site-packages/curl_cffi/requests/session.py", line 978, in ws_connect
self._set_curl_options(curl, "GET", url, *args, **kwargs)
TypeError: BaseSession._set_curl_options() got an unexpected keyword argument 'on_open'
The text was updated successfully, but these errors were encountered:
Terminal error
The text was updated successfully, but these errors were encountered: