Skip to content

How do I capture WebSocket data #2697

Answered by MihaZupan
JSpate asked this question in Q&A
Discussion options

You must be logged in to vote

YARP will forward WebSocket traffic as-is, that is, we won't try to buffer/parse out and reframe individual messages.

If you want access to the raw WebSocket connection, you'd have to intercept the streams created when the request is upgraded to WS.
Note that this is only useful if you're willing to manually parse the WebSocket protocol to detect frames.
An example of doing something like that is here:
https://github.com/microsoft/reverse-proxy/blob/main/src/ReverseProxy/WebSocketsTelemetry/WebSocketsTelemetryMiddleware.cs

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MihaZupan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants