diff --git a/README.md b/README.md index 4f14154..1fb33fd 100644 --- a/README.md +++ b/README.md @@ -164,10 +164,10 @@ Then use websocket_client_handler_cls parameter: ```python import asyncio -from fastapi_websocket_rpc import RpcMethodsBase, WebSocketRpcClient, WebSocketClientHandler +from fastapi_websocket_rpc import RpcMethodsBase, WebSocketRpcClient, ProxyEnabledWebSocketClientHandler async def run_client(uri): - async with WebSocketRpcClient(uri, RpcMethodsBase(), websocket_client_handler_cls = WebSocketClientHandler) as client: + async with WebSocketRpcClient(uri, RpcMethodsBase(), websocket_client_handler_cls = ProxyEnabledWebSocketClientHandler) as client: ``` Just set standard environment variables (lowercase and uppercase works): http_proxy, https_proxy, and no_proxy before running python script. diff --git a/fastapi_websocket_rpc/__init__.py b/fastapi_websocket_rpc/__init__.py index 74f5a7f..662fe50 100644 --- a/fastapi_websocket_rpc/__init__.py +++ b/fastapi_websocket_rpc/__init__.py @@ -1,6 +1,6 @@ from .rpc_methods import RpcMethodsBase, RpcUtilityMethods from .websocket_rpc_client import WebSocketRpcClient -from .websocket_rpc_client import WebSocketClientHandler +from .websocket_rpc_client import ProxyEnabledWebSocketClientHandler from .websocket_rpc_client import WebSocketsClientHandler from .websocket_rpc_endpoint import WebsocketRPCEndpoint from .rpc_channel import RpcChannel diff --git a/fastapi_websocket_rpc/websocket_rpc_client.py b/fastapi_websocket_rpc/websocket_rpc_client.py index e7e742c..312d992 100644 --- a/fastapi_websocket_rpc/websocket_rpc_client.py +++ b/fastapi_websocket_rpc/websocket_rpc_client.py @@ -21,7 +21,7 @@ # Websocket-client optional module not installed. pass -class WebSocketClientHandler(SimpleWebSocket): +class ProxyEnabledWebSocketClientHandler (SimpleWebSocket): """ Handler that use https://websocket-client.readthedocs.io/en/latest module. This implementation supports HTTP proxy, though HTTP_PROXY and HTTPS_PROXY environment variable.