Skip to content

Allow to read WebSocket handshake request headers #12

Description

@flowersinthesand

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);

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions