Skip to content

Commit

Permalink
WebSocketClientHandshaker: add public accessors for parameters (#13009)
Browse files Browse the repository at this point in the history
Motivation:

Websocket client & server handshakers may be extended with custom frame encoder / decoder,
however client handshaker parameters are private so cant be accessed by custom frame encoder / decoder.

Modifications:

WebSocketClientHandshaker: add public accessors for parameters.

Result:

Custom frame encoder / decoder may be provided with websocket client handshaker parameters
  • Loading branch information
mostroverkhov authored and normanmaurer committed Nov 21, 2022
1 parent 7cd2192 commit 83b41e9
Showing 1 changed file with 12 additions and 2 deletions.
Expand Up @@ -167,8 +167,6 @@ public WebSocketClientHandshaker13(URI webSocketURL, String subprotocol,
* @param webSocketURL
* URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
* sent to this URL.
* @param version
* Version of web socket specification to use to connect to the server
* @param subprotocol
* Sub protocol request sent to the server.
* @param allowExtensions
Expand Down Expand Up @@ -331,4 +329,16 @@ private static String createNonce() {
var nonce = WebSocketUtil.randomBytes(16);
return WebSocketUtil.base64(nonce);
}

public boolean isAllowExtensions() {
return allowExtensions;
}

public boolean isPerformMasking() {
return performMasking;
}

public boolean isAllowMaskMismatch() {
return allowMaskMismatch;
}
}

0 comments on commit 83b41e9

Please sign in to comment.