-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
[enhancement] add websocket support? #222
Comments
A good idea in general to allow upgrading from simple tcp to websocket. I just see problems when you have defined multiple upstreams, then rpxy has to make sure that the websocket connection stays alive to the specific upstream. |
Rpxy itself supports upgrading to websocket via http 101 switching protocols, which is actually the only use case of websocket in the context of http. If we consider upgrading directly from tcp, then we have to or should redesign rpxy as more general purpose reverse proxy supporting http’s underlying protocols, i.e., tcp, tls, quic, etc. |
What is this "websocket from tcp" thing you are talking about? |
wdym host header? i just tried this import asyncio
import websockets
async def hello(websocket):
await websocket.send("Hello from server!")
while True:
try:
message = await websocket.recv()
print(f"Received: {message}")
await websocket.send(f"Server received: {message}")
except websockets.ConnectionClosed:
break
async def main():
async with websockets.serve(hello, "127.0.0.1", 5125):
print("WebSocket server running on ws://127.0.0.1:5125")
await asyncio.Future() # run forever
asyncio.run(main()) (forward from rpxy to 0.0.0.0) |
it seems websocket do not work(yet)
The text was updated successfully, but these errors were encountered: