-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No support of http_proxy https_proxy #31
Comments
Hi @antoinetran - no such plans at the moment. We would be willing to review a PR, if you'd be interested in contributing such a feature. |
Ok I will give a try, although I am not an Python expert. I saw that the fastpi websocket use lots of coroutine, but the websocket-client is not written in coroutine (see https://websocket-client.readthedocs.io/en/latest/threading.html#asyncio-library-usage). I will see what I can do. |
Ok, I tested a bit and it seems to work! Will do a PR, with a class parameter to choose which Websocket client implementation. By default, it should be the websockets, because it is natively coded as coroutine, but I will ship another class that implements SimpleWebSocket using websocket-client. I am not sure if my implementation is optimal. I will also add websocket-client as an dependency of this framework and modify the README a bit to show how to change the implementation to use proxy. |
@antoinetran Hey, I've created a patch for websockets to use with proxy servers: https://github.com/racinette/websockets_proxy |
Nice! You are free to provide your own websocket client handler to fastapi websocket rpc, in for example your module. But for now, I would rather stick with the official websocket client, and in the future, only the websockets, when their team will fix support of http proxy. |
Should it be closed now by #32? |
The framework uses websockets module (here).
The websockets module does not support HTTP proxy (see python-websockets/websockets#364, issue from 2018), while websocket-client module (here) supports it.
Are they plans to migrate websockets implementations though websocket-client instead?
The text was updated successfully, but these errors were encountered: