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

Allow to read WebSocket handshake request headers #12

flowersinthesand opened this Issue May 22, 2018 · 0 comments


None yet
1 participant

flowersinthesand commented May 22, 2018

The WebSocket interface specified by W3C and available in browsers doesn't allow to set request headers but in some cases request headers are used and can be configured. For example, subprotocol names are transmitted through Sec-WebSocket-Protocol header field. Also, this restriction is only valid in browser-based applications.

This feature allows to read WebSocket handshake request headers without unwrapping a ServerWebSocket instance to access underlying objects so that a developer should be able to retrieve headers such as Authorization and Sec-WebSocket-Protocol and use them to implement some protocol.

The following methods will be added in ServerWebSocket as handshake request header accessors:

  • Set<String> headerNames();
  • String header(String name);
  • List<String> headers(String name);

@flowersinthesand flowersinthesand added this to the 2.0.0-Alpha2 milestone May 22, 2018

@flowersinthesand flowersinthesand self-assigned this May 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment