CodecException: invalid WebSocket Extension handshake for "permessage-deflate; client_no_context_takeover"

Hi! I get this error, which I’m not able to figure out.

It seems Gatling doesnt like the Sec-Websocket-Extensions response header?

val scn = scenario(scenarioName)
.exec(ws(“connect ws”).connect("/socket.io/?EIO=3&transport=websocket"))

val httpProtocol = http
.wsBaseUrl(“wss://mysite.com”)

~sbt gatling:test


---- Errors --------------------------------------------------------------------

i.n.h.c.CodecException: invalid WebSocket Extension handshake 1 (100,0%)
for “permessage-deflate; client_no_context_takeover”

Gatling 3.0.3. Here is the conversation when browsing the same site in Chrome (which works fine).

  1. Request URL:

    wss://mysite.com/socket.io/?EIO=3&transport=websocket

  2. Request Method:

    GET

  3. Status Code:

    101 Switching Protocols

  4. Response Headersview source

  5. Connection:

    upgrade

  6. Date:

    Tue, 05 Feb 2019 12:46:22 GMT

  7. Sec-WebSocket-Accept:

    DqJmFtz1G9/QNW0b9TFu5YydgbM=

  8. Sec-WebSocket-Extensions:

    permessage-deflate; client_no_context_takeover

  9. Sec-WebSocket-Version:

    13

  10. Server:

    nginx

  11. Upgrade:

    websocket

  12. WebSocket-Server:

    uWebSockets

  13. Request Headersview source

  14. Accept-Encoding:

    gzip, deflate, br

  15. Accept-Language:

    sv,en;q=0.9,en-US;q=0.8

  16. Cache-Control:

    no-cache

  17. Connection:

    Upgrade

  18. Cookie:

    sfbShellAppLaunched=yes; sfbShellAppVersion=1.0.0.186; devid=a395ce8f-f1a8-487d-c092-df71124a16cb; consent=true; show-cookie-info=f,f,t; consent=t,t,f; io=rFg0v0wPcO81UQLNAAit; show-cookie-info=false

  19. Host:

    mysite.com

  20. Origin:

    https://mysite.com

  21. Pragma:

    no-cache

  22. Sec-WebSocket-Extensions:

    permessage-deflate; client_max_window_bits

  23. Sec-WebSocket-Key:

    6UZqKbW7JGiUlK61GIBWMg==

  24. Sec-WebSocket-Version:

    13

  25. Upgrade:

    websocket

  26. User-Agent:

    Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36

Here is another example, using a publicly available site:

val scn = scenario(scenarioName)
.exec(ws(“connect ws”).connect("/socket.io/?EIO=3&transport=websocket&sid=BpvegaGfaVW88hbVAVHm"))

val httpProtocol = http
.wsBaseUrl(“wss://socket-io-chat.now.sh”)

The problem is that we don’t currently allow client_no_context_takeover.
Will fix in next release.

Great, thanks!