Skip to content
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

Merged
merged 6 commits into from
Oct 25, 2018

Conversation

alyssawilk
Copy link
Contributor

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

@alyssawilk
Copy link
Contributor Author

@rshriram or @moderation may want to take a look too?

@alyssawilk
Copy link
Contributor Author

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.

@PiotrSikora
Copy link
Contributor

PiotrSikora commented Oct 17, 2018

@alyssawilk you need to update the build image in .circleci/config.yml:

--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -4,7 +4,7 @@ executors:
   ubuntu-build:
     description: "A regular build executor based on ubuntu image"
     docker:
-      - image: envoyproxy/envoy-build:faea2a2ebc397b7a3a5e3c877ceaefc5cf4daf25
+      - image: envoyproxy/envoy-build:7971d426155c3a9cc3e2b99bc7802b6b22df7a09
     resource_class: xlarge
     working_directory: /source

@rshriram
Copy link
Member

This is great!! don't care much about being able to support upgrades on requests with bodies.

@alyssawilk alyssawilk force-pushed the h2_final branch 3 times, most recently from 703ab00 to 4ab867c Compare October 18, 2018 13:12
@alyssawilk
Copy link
Contributor Author

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.

@alyssawilk alyssawilk force-pushed the h2_final branch 2 times, most recently from d226559 to fe3ef7a Compare October 18, 2018 13:53
@alyssawilk
Copy link
Contributor Author

Ping!

Copy link
Member

@mattklein123 mattklein123 left a 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a master merge.

// 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")) {
Copy link
Member

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>`
Copy link
Member

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]>
Copy link
Member

@mattklein123 mattklein123 left a 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) \
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants