-
Notifications
You must be signed in to change notification settings - Fork 818
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
TS-4698: Adds an API call to identify WebSocket requests. #822
Conversation
Cool. Couple of things:
|
[approve ci] |
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/477/ for details. |
Linux build successful! See https://ci.trafficserver.apache.org/job/Github-Linux/374/ for details. |
sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS); | ||
|
||
HttpSM *sm = (HttpSM *)txnp; | ||
return sm->t_state.is_upgrade_request && sm->t_state.upgrade_token_wks == MIME_VALUE_WEBSOCKET; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you test HttpTransact::State::is_websocket
? That seems like the correct check in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping @ogoodman
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why I didn't spot that before. Done.
[approve ci] |
Linux build failed! See https://ci.trafficserver.apache.org/job/Github-Linux/756/ for details. |
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/860/ for details. |
Add the TSHttpTxnIsWebsocket API to make it possible for plugins to detect incoming WebSocket connections and thereby provide WebSocket termination if desired. This closes apache#822.
These are cherry-picks from asf that has the fix for crash caused by H2 CONNECT. * Added http connect Autest with proxy verifier (apache#9315) * Added a HTTP CONNECT test using proxy verifier * Updated comment * added proxy-response verification (cherry picked from commit b5f2023) * Added Autest for H2 CONNECT and fix a crash triggered by the test (apache#9781) In apache#9616, @maskit wrote an H2 CONNECT Autest but couldn't include that in the final PR because of a Proxy Verifier issue. Now that the Proxy Verifier issue is resolved, the Autest is added in this PR(with a few tweaks). ATS crashes with the new test executing HTTP/2 tunneling traffic. This PR also includes a fix to resolve that. (cherry picked from commit df7ccfe) * Update to Proxy Verifier v2.8.1 (apache#9834) Proxy Verifier v2.8.1 has fixes for the way Proxy Verifier relates to HTTP/2 CONNECT method request pseudo header fields. This will be helpful for testing HTTP/2 CONNECT requests. (cherry picked from commit d5c47a7)
This makes it possible for plugins to detect incoming WebSocket connections and thereby provide WebSocket termination if desired. An example will be given in a PR addressing TS-4699.