Setting ws subprotocol in Gatling

Hi guys,

I’m looking at Gatling for som internal websocket load tests and our websocket requires a sub protocol so my question is :

How/if I can set the ws subprotocol handshake field when opening a web socket ?

For instance, is there anything similar to:

exec(ws("Connect WS").open("/myWebSocket/param1?a=b").withSubProtocol("mySubProtocol"))

Cheers,
Niklas

You should just have to set the “Sec-WebSocket-Protocol” header and friends when opening the WebSocket:

exec(ws("Connect WS").open("/myWebSocket/param1?a=b").header("Sec-WebSocket-Protocol", "mySubProtocol"))