New issue
Advanced search Search tips

Issue 768328 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Sep 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Feature



Sign in to add a comment

Websocket - support for custom headers for handshake

Reported by t.jag...@gmail.com, Sep 25 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36

Example URL:

Steps to reproduce the problem:
please consider adding ability to add custom headers for handshake.
In RFC6455 there one interesting point:

The request MAY include any other header fields, for example,
cookies [RFC6265] and/or authentication-related header fields
such as the |Authorization| header field [RFC2616], which are
processed according to documents that define them.
I've found an example how to add custom header to handshake: https://blog.heckel.xyz/2014/10/30/http-basic-auth-for-websocket-connections-with-undertow/ but this is for Java and unfortunately isn't possible in HTML5.

When searching over the net I found many places question about this option, for example:
sta/websocket-sharp#22
https://stackoverflow.com/questions/4361173/http-headers-in-websockets-client-api/4361358#4361358
aspnet/SignalR#888

For example in Python this is possible https://stackoverflow.com/questions/15381414/sending-custom-headers-in-websocket-handshake. Other languages also support this. Last place missing is the browser.

Please consider adding this into specification. Having this even as a draft would allow us to consider browser vendors to add support for it.

If this is incorrect place for adding request about specification please forgive me and please point me to right place.

What is the expected behavior?

What went wrong?
Currently setting custom headers isn't supported.
I've filled feature request in WHATWG (https://github.com/whatwg/html/issues/3062) but I was asked to create feature requests for each main browser. Having Your interest this feature could be added to standard.

Did this work before? N/A 

Chrome version: 60.0.3112.113  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 27.0 r0
 
Labels: -Type-Bug Type-Feature

Comment 2 by rch@chromium.org, Sep 25 2017

Components: -Internals>Network Blink>Network>WebSockets
Thanks for filing the bug. Replied to the spec discussion as https://github.com/whatwg/html/issues/3062#issuecomment-332065429

Comment 4 by ricea@chromium.org, Sep 26 2017

Status: WontFix (was: Unconfirmed)
Thank you for raising this issue.

We do not plan to implement this. I stated my reasoning at https://github.com/whatwg/html/issues/3062#issuecomment-332065542.

It possible that in future the cost/benefit tradeoff will change. But this will not happen in the near term, so I am closing this issue.

Sign in to add a comment