Config value for reading frames as passthrough#371
Config value for reading frames as passthrough#371Rwardc wants to merge 2 commits intosnapview:masterfrom
Conversation
daniel-abramov
left a comment
There was a problem hiding this comment.
Sorry for taking so long to reply to this - I was waiting for CI to succeed, but for some reason, the pipeline did not run for your PR (it might be that it happened while fixes to the pipelines were in progress).
I'm generally not opposed to the concept of introducing this logic, but I'm not sure if the suggested change is mostly for 2 reasons:
- I feel like it's not suitable for a long-term solution. As you've already noted, this might be considered a temporary change, which makes me think if it's actually something we want to have.
- The state machine code gets some additional branching and complexity (honestly, it's already quite complex to the point that we would need to refactor it before doing this change), but additional handling of the
read_as_framesoption by checking the frame one more time, callingdo_close()etc, makes it a bit harder to verify.
|
We ended up forking this repo to handle the issue. We are writing a proxy and needed error free tunneling of websocket frames without any intermediate processing. This config value helped to achieve this goal. In answer to your questions:
I would be interested in the level of effort required to get this into the mainline, especially since we don't necessarily like to keep long lived forks. |
Alright! So what do we do with the PR then? Would you be fine closing this PR and then opening a new one should you decide for a "clean" (long-term) implementation? |
Reasoning
I've added this new, hopefully non-invasive config value to the
WebSocketConfigstruct to allow for the following:We are currently working on a rust-based proxy project that uses a library that in turn uses tungstenite. We were experiencing issues proxying the websocket traffic and tracked the issue down to tungstenite dropping all extended frames. I see this as a temporary issue until negotiated extensions are handled by tungstenite, or a proper API for processing raw extended frames is provided.