Skip to content

Commit

Permalink
Renamed WebSocketClientHandler to ProxyEnabledWebSocketClientHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
trana authored and trana committed Dec 21, 2023
1 parent 54e12ef commit 385df43
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion fastapi_websocket_rpc/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion fastapi_websocket_rpc/websocket_rpc_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 385df43

Please sign in to comment.