-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
http: turning up H2 websocket support #4767
Conversation
Signed-off-by: Alyssa Wilk <[email protected]>
@rshriram or @moderation may want to take a look too? |
Huh, #4761 landed, it caused a new docker image, https://hub.docker.com/r/envoyproxy/envoy/tags/, this should Just Work (TM) but something about the old nghttp2 library is getting cached somewhere. I'll see if I can sort it out tomorrow. |
@alyssawilk you need to update the build image in
|
This is great!! don't care much about being able to support upgrades on requests with bodies. |
703ab00
to
4ab867c
Compare
Oh thanks Piotr! I'd remembered it was latched somewhere and was failing to find it. That plus the proper hash (I was grabbing envoyproxy/envoy not envoyproxy/envoy-build hashes) did it. |
d226559
to
fe3ef7a
Compare
Signed-off-by: Alyssa Wilk <[email protected]>
Ping! |
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.
LGTM!
@@ -20,8 +20,8 @@ one can set up custom | |||
for the given upgrade type, up to and including only using the router filter to send the WebSocket | |||
data upstream. | |||
|
|||
Handling H2 hops (implementation in progress) | |||
--------------------------------------------- | |||
Handling H2 hops |
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.
Needs a master merge.
source/common/http/utility.cc
Outdated
// nghttp2 rejects upgrade requests/responses with content length, so strip | ||
// any unnecessary content length header. | ||
if (headers.ContentLength() != nullptr && | ||
headers.ContentLength()->value().c_str() == std::string("0")) { |
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.
perf nit: you can do this w/o string creation. Same below.
@@ -6,6 +6,7 @@ Version history | |||
* admin: added support for displaying subject alternate names in :ref:`certs<operations_admin_interface_certs>` end point. | |||
* config: removed support for the v1 API. | |||
* fault: removed integer percentage support. | |||
* http: Added HTTP/2 WebSocket proxying via :ref:`extended CONNECT <envoy_api_field_core.Http2ProtocolOptions.allow_connect>` |
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.
Related to my comment on the old style removal PR, but do we need any stats/observability for this stuff? If so it's fine to track as a follow up but might want to put in a TODO somewhere?
Signed-off-by: Alyssa Wilk <[email protected]>
Signed-off-by: Alyssa Wilk <[email protected]>
Signed-off-by: Alyssa Wilk <[email protected]>
Signed-off-by: Alyssa Wilk <[email protected]>
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.
Nice!
@@ -17,6 +17,7 @@ namespace Http { | |||
COUNTER (downstream_cx_total) \ | |||
COUNTER (downstream_cx_ssl_total) \ | |||
COUNTER (downstream_cx_http1_total) \ | |||
COUNTER (downstream_cx_upgrades_total) \ |
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.
I'm a little concerned this might be confusing for people looking for WS socket stats? Probably not actionable right now but something to think about. Not sure if folks will find it confusing or not. We might want to have more docs on this? Feel free to do in your other removal PR if you are inclined.
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.
SGTM
The main difference between what we had and official nghttp2 support is lack of support for upgrade-with-bodies (on request or response path). Adjusted header munging, tests, and docs accordingly.
Risk Level: Low (changes code on a "hidden" code path)
Testing: updated tests, new unit tests
Docs Changes: updated
Release Notes: noted H2 websocket support
Fixes #1630