-
Notifications
You must be signed in to change notification settings - Fork 7
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
[RFC]: add callback
api to WebSocketProxy
#40
Comments
We use a closable pipeline to implement this functionality. The diagram is as follows: flowchart LR;
Client -->|A| CallbackReceive;
CallbackReceive -->|B| CallbackSend;
CallbackSend -->|C| TargetServer;
A and C are Anyio's For ExceptionsIf any of the pipelines(A, B, or C) encounter an exception, the if an exception occurs in the proxy, what do you want the
|
CC @IvesAwadi What do you think? |
Looks good to me. |
WebSocket
callback
api to WebSocketProxy
callback
api to WebSocketProxy
callback
api to WebSocketProxy
callback
api to WebSocketProxy
callback
api to WebSocketProxy
Have you discussed it?
Discussed in #39
Originally posted by IvesAwadi July 15, 2024
Thank you for the library, it's amazing so far but for some reason I can't figure out how to log incoming data from the WebSocket and also read its responses.
Describe your feature request
Add a callback function API to
ReverseWebSocketProxy
so that we can use the callback function to modify the messages received and sent by the client.Is your feature request related to a problem? Please describe
Describe the solution you'd like
Something like:
Describe alternatives you've considered
Or would this API be better? It would offer higher performance but be more low-level. So it wouldn't allow for background tasks after sending a message or ensuring the order of message receipt.
Additional context
For the first API, it is necessary to consider exceptions and disconnections:
if an exception occurs in the proxy, what do you want the callback to receive; or conversely, if an exception occurs in the callback, what should the proxy send to the client?
The text was updated successfully, but these errors were encountered: