-
Notifications
You must be signed in to change notification settings - Fork 107
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
Gorouter: Websockets over HTTP/2 - invalid pseudo-header ":protocol" #230
Comments
My initial thoughts: Given the discussion in golang/go#32763, it seems like it will be difficult to get RFC 8441 support for Gorouter any time soon (let me know if I'm missing something that would make it possible 🙂). Based on that, it seems like the next best option would be to make HAProxy (and other clients) use HTTP/1.X for websockets requests. We already impose some Load Balancer configuration requirements for supporting websockets on CF: https://docs.cloudfoundry.org/adminguide/supporting-websockets.html#config. Doing a little digging, I found haproxy/haproxy@befeae8, though I'm not sure how it impacts HAProxy's backend connections. |
I applied haproxy/haproxy@befeae8 as a patch to the existing HAProxy release and configured |
I was able to hack together a HAProxy config that appears to work for websockets: Relevant excerpts:
|
Related issue: cloudfoundry/routing-release#230 [cloudfoundry/routing-release#200] Authored-by: Greg Cobb <[email protected]>
@thomas-kaltenbach Given the changes introduced in cloudfoundry/haproxy-boshrelease#263, is there any remaining work for this issue? |
Hi @Gerg, note that Thomas moved within our Org, taking over. In cloudfoundry/haproxy-boshrelease#263 we downgrade all websockets to h/1 even though h/2 is configured. |
Hi @plowin , Checking in on this issue. Is there any further work at this point or is it safe to close this out? |
Hi @MarcPaquette , thx for re-assigning. |
Is this a security vulnerability?
no
Issue
Gorouter is not able to handle HTTP/2 Websockets requests (RFC 8441).
Affected Versions
latest version when http2 is enabled
Context
We are testing currently the http/2 feature and we noticed that websockets over http/2 are not working. Gorouter is closing the connection without any http response. After activating golang verbose logging (
GODEBUG=http2debug=2
) you can see the followed log entries:Traffic Diagram
Steps to Reproduce
I could also reproduce the issue with the followed nodejs client
Steps to run it:
npm install ws http2-wrapper
node <filename> https://<url_gorouter>
Expected result
One of the following behaviors would be acceptable:
Current result
HAproxy reporting the issue with the termination state
SH--
in the accesslog.nodejs client reports followed error:
Possible Fix
Root cause of the problem is the followed check:
https://github.com/golang/go/blob/e180e2c27c3c3f06a4df6352386efedc15a1e38c/src/net/http/h2_bundle.go#L2770
I also found followed issue golang/go#32763
I don't know if gorouter can workaround the problem or at least return a proper http response.
The text was updated successfully, but these errors were encountered: