ARTEMIS-271 Expose HttpRequest in WebSocketServerHandler
This commit is contained in:
parent
7afd337496
commit
aa492fb9b6
|
@ -49,6 +49,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
|
|||
|
||||
private static final String WEBSOCKET_PATH = "/stomp";
|
||||
|
||||
private HttpRequest httpRequest;
|
||||
private WebSocketServerHandshaker handshaker;
|
||||
private static final BinaryWebSocketEncoder BINARY_WEBSOCKET_ENCODER = new BinaryWebSocketEncoder();
|
||||
|
||||
|
@ -75,6 +76,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
|
|||
|
||||
// Handshake
|
||||
WebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(this.getWebSocketLocation(req), "v10.stomp,v11.stomp", false);
|
||||
this.httpRequest = req;
|
||||
this.handshaker = wsFactory.newHandshaker(req);
|
||||
if (this.handshaker == null) {
|
||||
WebSocketServerHandshakerFactory.sendUnsupportedWebSocketVersionResponse(ctx.channel());
|
||||
|
@ -140,6 +142,10 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
|
|||
return "ws://" + req.headers().get(HttpHeaders.Names.HOST) + WEBSOCKET_PATH;
|
||||
}
|
||||
|
||||
public HttpRequest getHttpRequest() {
|
||||
return this.httpRequest;
|
||||
}
|
||||
|
||||
@Sharable
|
||||
private static final class BinaryWebSocketEncoder extends ChannelOutboundHandlerAdapter {
|
||||
|
||||
|
|
Loading…
Reference in New Issue