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

Give hints about HTTP/2 and HTTP/3 support when opening a WebSocket #19

Open
ddragana opened this issue Oct 20, 2021 · 3 comments
Open
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest

Comments

@ddragana
Copy link

WebSockets over HTTP/2 are not supported by many servers. There can be different reasons for that. Support for WebSockets over HTTP/3 is a new IETF draft.

The clients do not know if WebSockets are supported by a HTTP/2 or HTTP/3 server until the TLS handshake is done and SETTINGS frames are exchange. If WebSockets are not supported the clients need to fall back to HTTP/1.1 and open a new connection. This adds a delay, trying HTTP/2 and HTTP/3 would add even more delay.

An option to eliminate trying HTTP/2 and HTTP/3 is to have hint from developer when WebSocket is created whether the servers support the feature. And if they do not support the feature, the client will use HTTP/1.1 directly.

@annevk suggested to have a way to ask for a dedicated connection, that would mean use HTTP/1.1 .

@ricea and @youennf may be you have some feedback.

@annevk annevk added addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: websockets labels Oct 20, 2021
@ricea
Copy link
Collaborator

ricea commented Oct 21, 2021

We don't try WebSocket over HTTP/2 at all unless there is an existing HTTP/2 connection which has already indicated via SETTINGS that WebSocket is supported. So there is no delay, but servers may end up not getting WebSocket over HTTP/2 when they expected it.

For better predictability, I'd like to be able to use WebSocket over HTTP/2 even when there is no existing connection. Perhaps a constructor option is the best way to achieve that.

It would be nice to align with whatever WebTransport does when it adds an HTTP/2 fallback.

@annevk
Copy link
Member

annevk commented Oct 21, 2021

cc @yutakahirano

@SethiVanshika
Copy link

Hey @ddragana could you assign this to me please?

@domenic domenic transferred this issue from whatwg/html Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest
Development

No branches or pull requests

5 participants