netty5/codec-http/src/main/java/io/netty/handler/codec/http/websocketx
Matthias Einwag 01e3bcf30c Add verification for websocket subprotocol on the client side.
Motivation:

Websocket clients can request to speak a specific subprotocol. The list of
subprotocols the client understands are sent to the server. The server
should select one of the protocols an reply this with the websocket
handshake response. The added code verifies that the reponded subprotocol
is valid.

Modifications:

Added verification of the subprotocol received from the server against the
subprotocol(s) that the user requests. If the user requests a subprotocol
but the server responds none or a non-requested subprotocol this is an
error and the handshake fails through an exception. If the user requests
no subprotocol but the server responds one this is also marked as an
error.

Addiontionally a getter for the WebSocketClientHandshaker in the
WebSocketClientProtocolHandler is added to enable the user of a
WebSocketClientProtocolHandler to extract the used negotiated subprotocol.

Result:

The subprotocol field which is received from a websocket server is now
properly verified on client side and clients and websocket connection
attempts will now only succeed if both parties can negotiate on a
subprotocol.
If the client sends a list of multiple possible subprotocols it can
extract the negotiated subprotocol through the added handshaker getter (WebSocketClientProtocolHandler.handshaker().actualSubprotocol()).
2014-10-13 07:35:31 +02:00
..
BinaryWebSocketFrame.java Enable a user specify an arbitrary information with ReferenceCounted.touch() 2014-02-13 18:16:25 -08:00
CloseWebSocketFrame.java Fix NPE problems 2014-07-20 12:55:22 +02:00
ContinuationWebSocketFrame.java Remove ContinuationWebSocketFrame.aggregatedText() 2014-04-30 14:49:17 +02:00
package-info.java Use our own URL shortener wherever possible 2014-07-31 17:06:19 -07:00
PingWebSocketFrame.java Enable a user specify an arbitrary information with ReferenceCounted.touch() 2014-02-13 18:16:25 -08:00
PongWebSocketFrame.java Enable a user specify an arbitrary information with ReferenceCounted.touch() 2014-02-13 18:16:25 -08:00
TextWebSocketFrame.java Enable a user specify an arbitrary information with ReferenceCounted.touch() 2014-02-13 18:16:25 -08:00
Utf8Validator.java Remove ContinuationWebSocketFrame.aggregatedText() 2014-04-30 14:49:17 +02:00
WebSocket07FrameDecoder.java #751 - Added support for legacy websocket v7 in order to pass SocksJS tests 2012-12-19 12:35:56 +01:00
WebSocket07FrameEncoder.java #751 - Added support for legacy websocket v7 in order to pass SocksJS tests 2012-12-19 12:35:56 +01:00
WebSocket08FrameDecoder.java Improve WebSocket performance 2014-10-12 19:48:49 +02:00
WebSocket08FrameEncoder.java Avoid vectored writes for small websocket messages 2014-10-12 20:12:07 +02:00
WebSocket13FrameDecoder.java Update license headers 2012-06-04 13:31:44 -07:00
WebSocket13FrameEncoder.java Update license headers 2012-06-04 13:31:44 -07:00
WebSocket00FrameDecoder.java Fixed NPE in WebSocket00FrameDecoder if end couldn't be found in text frame 2014-07-16 20:03:57 +02:00
WebSocket00FrameEncoder.java [#2768] Correctly duplicate buffer for CloseWebSocketFrames 2014-08-14 09:54:35 +02:00
WebSocketClientHandshaker.java Add verification for websocket subprotocol on the client side. 2014-10-13 07:35:31 +02:00
WebSocketClientHandshaker07.java Remove 'get' prefix from all HTTP/SPDY messages 2014-06-24 18:03:33 +09:00
WebSocketClientHandshaker08.java Remove 'get' prefix from all HTTP/SPDY messages 2014-06-24 18:03:33 +09:00
WebSocketClientHandshaker13.java Remove 'get' prefix from all HTTP/SPDY messages 2014-06-24 18:03:33 +09:00
WebSocketClientHandshaker00.java Remove 'get' prefix from all HTTP/SPDY messages 2014-06-24 18:03:33 +09:00
WebSocketClientHandshakerFactory.java Remove 'get' prefix from all HTTP/SPDY messages 2014-06-24 18:03:33 +09:00
WebSocketClientProtocolHandler.java Add verification for websocket subprotocol on the client side. 2014-10-13 07:35:31 +02:00
WebSocketClientProtocolHandshakeHandler.java Fix the leak in the WebSocketClientProtocolHandshakeHandler 2014-10-12 20:26:12 +02:00
WebSocketFrame.java Enable a user specify an arbitrary information with ReferenceCounted.touch() 2014-02-13 18:16:25 -08:00
WebSocketFrameAggregator.java Introduce MessageAggregator and DecoderResultProvider 2014-06-05 16:51:14 +09:00
WebSocketFrameDecoder.java [#1515] Add WebSocketFrameEncoder and WebSocketFrameDecoder interfaces and let our impls implement it 2013-07-04 06:41:22 +02:00
WebSocketFrameEncoder.java [#1515] Add WebSocketFrameEncoder and WebSocketFrameDecoder interfaces and let our impls implement it 2013-07-04 06:41:22 +02:00
WebSocketHandshakeException.java Update license headers 2012-06-04 13:31:44 -07:00
WebSocketProtocolHandler.java Allow per-write promises and disallow promises on flush() 2013-07-11 00:49:48 +09:00
WebSocketServerHandshaker.java Fix #2275 %s WebSocket version %s server handshake 2014-02-28 17:19:18 -08:00
WebSocketServerHandshaker07.java Synchronized between 4.1 and master 2014-04-25 00:38:02 +09:00
WebSocketServerHandshaker08.java Synchronized between 4.1 and master 2014-04-25 00:38:02 +09:00
WebSocketServerHandshaker13.java Use our own URL shortener wherever possible 2014-07-31 17:06:19 -07:00
WebSocketServerHandshaker00.java Backport the additional AsciiString/TextHeader changes from master 2014-06-14 17:33:34 +09:00
WebSocketServerHandshakerFactory.java [#2088] Introduce sendUnsupportedVersionResponse(...) methods which allows to use the ChannelFuture/ChannelPromise to get notified once the response was send. 2014-01-03 11:11:08 +01:00
WebSocketServerProtocolHandler.java Remove 'get' prefix from all HTTP/SPDY messages 2014-06-24 18:03:33 +09:00
WebSocketServerProtocolHandshakeHandler.java Fix most inspector warnings 2014-07-02 19:55:07 +09:00
WebSocketUtil.java [#1579] Fix resource leakage in WebSocketUtil.base64(...) 2013-07-15 19:12:24 +02:00
WebSocketVersion.java #751 - Added support for legacy websocket v7 in order to pass SocksJS tests 2012-12-19 12:35:56 +01:00