# CodecException: invalid WebSocket Extension handshake for "permessage-deflate; client\_no\_context\_takeover"

**URL:** <https://community.gatling.io/t/codecexception-invalid-websocket-extension-handshake-for-permessage-deflate-client-no-context-takeover/4798>\
**Category:** Gatling (Open-Source)\
**Created:** [February 5, 2019, 1:02pm UTC](https://community.gatling.io/t/codecexception-invalid-websocket-extension-handshake-for-permessage-deflate-client-no-context-takeover/4798 "2019-02-05T13:02:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lars.holmberg](https://avatars.discourse-cdn.com/v4/letter/l/34f0e0/32.png) [@lars.holmberg](https://community.gatling.io/u/lars.holmberg)\
**Post date:** [February 5, 2019, 1:02pm UTC](https://community.gatling.io/t/codecexception-invalid-websocket-extension-handshake-for-permessage-deflate-client-no-context-takeover/4798/1 "2019-02-05T13:02:18Z")

</div>

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:

2. Request Method:

3. Status Code:

4. Response Headersview source

5. Connection:

6. Date:

7. Sec-WebSocket-Accept:

8. Sec-WebSocket-Extensions:

9. Sec-WebSocket-Version:

10. Server:

11. Upgrade:

12. WebSocket-Server:

13. Request Headersview source

14. Accept-Encoding:

15. Accept-Language:

16. Cache-Control:

17. Connection:

18. Cookie:

19. Host:

20. Origin:

21. Pragma:

22. Sec-WebSocket-Extensions:

23. Sec-WebSocket-Key:

24. Sec-WebSocket-Version:

25. Upgrade:

26. User-Agent:

---

<div class="post-metadata">

**Author:** ![lars.holmberg](https://avatars.discourse-cdn.com/v4/letter/l/34f0e0/32.png) [@lars.holmberg](https://community.gatling.io/u/lars.holmberg)\
**Post date:** [February 5, 2019, 1:23pm UTC](https://community.gatling.io/t/codecexception-invalid-websocket-extension-handshake-for-permessage-deflate-client-no-context-takeover/4798/2 "2019-02-05T13:23:47Z")

</div>

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”)

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [February 5, 2019, 2:13pm UTC](https://community.gatling.io/t/codecexception-invalid-websocket-extension-handshake-for-permessage-deflate-client-no-context-takeover/4798/3 "2019-02-05T14:13:26Z")

</div>

The problem is that we don’t currently allow client\_no\_context\_takeover.  
Will fix in next release.

---

<div class="post-metadata">

**Author:** ![Lars\_Holmberg](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@Lars\_Holmberg](https://community.gatling.io/u/Lars_Holmberg)\
**Post date:** [February 5, 2019, 2:17pm UTC](https://community.gatling.io/t/codecexception-invalid-websocket-extension-handshake-for-permessage-deflate-client-no-context-takeover/4798/4 "2019-02-05T14:17:11Z")

</div>

Great, thanks!
