Hi all,
I’m trying to use Websockets with extensions but they are not working.
Could someone shed light on this problem?
The example code is very simple:
`
val headers_wss = Map(
“Accept-Encoding” → “gzip, deflate, sdch, br”,
“Accept-Language” → “es,en;q=0.8”,
“Pragma” → “no-cache”,
“Cache-Control” → “no-cache”,
“Connection” → “Upgrade”,
"Sec-WebSocket-Extensions" → “permessage-deflate; client_max_window_bits”, // if this header is included the following exception is raised
“Sec-WebSocket-Key” → “Soc5rel3sgoH5Ku2ZWcHjQ==”,
“Sec-WebSocket-Version” → “13”,
“Upgrade” ->“websocket”)
val scnWebsocketsSecure = scenario(“WebSockets Secure scenario”)
.exec(ws(“socket”)
.open(“wss://echo.websocket.org/?encoding=text”)
.headers(headers_wss)
.check(wsAwait.within(120).until(1).regex(".id."))
)
.exec(ws(“socket”).close)
setUp(scnWebsocketsSecure.inject(atOnceUsers(1)))
`
- this code is not exacly the same code I’m testing.
Output:
08:37:21.288 [WARN ] o.a.n.h.WebSocketHandler - onError {}
io.netty.handler.codec.CorruptedFrameException: RSV != 0 and no extension negoti
ated, RSV:4
at io.netty.handler.codec.http.websocketx.WebSocket08FrameDecoder.protoc
olViolation(WebSocket08FrameDecoder.java:434)
at io.netty.handler.codec.http.websocketx.WebSocket08FrameDecoder.decode
(WebSocket08FrameDecoder.java:156)
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.j
ava:367)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessage
Decoder.java:248)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst
ractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst
ractChannelHandlerContext.java:328)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(Abstra
ctChannelHandlerContext.java:321)
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1070)
at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:904)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageD
ecoder.java:411)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessage
Decoder.java:248)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst
ractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst
ractChannelHandlerContext.java:328)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(Abstra
ctChannelHandlerContext.java:321)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(Defau
ltChannelPipeline.java:1280)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst
ractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst
ractChannelHandlerContext.java:328)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChanne
lPipeline.java:890)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(Abstra
ctNioByteChannel.java:131)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.jav
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEve
ntLoop.java:505)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.ja
va:419)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:391)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThread
EventExecutor.java:112)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorato
r.run(DefaultThreadFactory.java:145)
at java.lang.Thread.run(Thread.java:745)
08:37:21.292 [ERROR] o.a.n.w.NettyWebSocket - WebSocketListener.onError crash
java.lang.NullPointerException: null
at io.gatling.http.action.async.ws.WsListener.onError(WsListener.scala:5
0)
at org.asynchttpclient.netty.ws.NettyWebSocket.onError(NettyWebSocket.ja
va:152)
at org.asynchttpclient.netty.handler.WebSocketHandler.handleException(We
bSocketHandler.java:213)
at org.asynchttpclient.netty.handler.AsyncHttpClientHandler.exceptionCau
ght(AsyncHttpClientHandler.java:212)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(
AbstractChannelHandlerContext.java:273)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(
AbstractChannelHandlerContext.java:252)
at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(Ab
stractChannelHandlerContext.java:244)
at io.netty.channel.ChannelInboundHandlerAdapter.exceptionCaught(Channel
InboundHandlerAdapter.java:131)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(
AbstractChannelHandlerContext.java:273)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(
AbstractChannelHandlerContext.java:252)
at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(Ab
stractChannelHandlerContext.java:244)
at io.netty.channel.ChannelInboundHandlerAdapter.exceptionCaught(Channel
InboundHandlerAdapter.java:131)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(
AbstractChannelHandlerContext.java:273)
at io.netty.channel.AbstractChannelHandlerContext.notifyHandlerException
(AbstractChannelHandlerContext.java:831)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst
ractChannelHandlerContext.java:344)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst
ractChannelHandlerContext.java:328)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(Abstra
ctChannelHandlerContext.java:321)
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1070)
at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:904)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageD
ecoder.java:411)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessage
Decoder.java:248)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst
ractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst
ractChannelHandlerContext.java:328)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(Abstra
ctChannelHandlerContext.java:321)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(Defau
ltChannelPipeline.java:1280)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst
ractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst
ractChannelHandlerContext.java:328)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChanne
lPipeline.java:890)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(Abstra
ctNioByteChannel.java:131)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.jav
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEve
ntLoop.java:505)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.ja
va:419)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:391)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThread
EventExecutor.java:112)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorato
r.run(DefaultThreadFactory.java:145)
at java.lang.Thread.run(Thread.java:745)
Thx.