Websocket test ok with browser but crashes with Gatling

Hi guys,

I’m currently developing a Play Framework application with websockets and I want to do some load test with Gatling.

When I test my application opening a webserver from Chrome Dev tools everything looks ok:

enter image description here

But when I try to do the same with Gatling I get “Invalid status code 0”. I think there is no problem without Gatling … I think the problem is with Play but I’m not sure… I have tested my Gatling test with http://www.websocket.org/echo.html and it works.

My Gatling test:

class BasicTest extends Simulation {

val httpConf = http
.header(“Sec-WebSocket-Version”, “13”)
.header(“Sec-WebSocket-Extensions” , “permessage-deflate client_max_window_bits”)
.acceptEncodingHeader(“gzip, deflate”)
.userAgentHeader(“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.73 Safari/537.36”)

val scn = scenario(“WebSocket”)
.exec(ws(“Connect WS”).open("/socket"))
.exec(ws(“Close WS”).close)

setUp(scn.inject(rampUsers(1) over 1.seconds)).protocols(httpConf)

I get a similar error using wscat

enter image description here

I’m new in websockets stuff… so, any idea about what’s going on will be appreciated.


Same answer as on SOF: http://stackoverflow.com/questions/34061078/websocket-works-in-browser-but-hangs-from-other-clients

Sample plz

But what’s sure is that Gatling doesn’t support WebSocket Extensions atm.


The code is not public…

I’m testing now against https://github.com/JAVEO/clustered-chat#master which is pretty the same than my application and I get same results… “Invalid Status Code 0”

I don’t know if is something about my machine (mac os) but i have created another ws server with wscat (wscat -l 8080 -p 13) and pointing to this, my Gatling test works.


Now it works. Play by default works in port 9000 and I had this port binded with php-fpm… But I still don’t understand why Play not crashes when trying to bind the application to an already binded port.

Thanks guys.


Thanks for your feedback