# Connection getting closed to jetty server (websockets?)

**URL:** <https://community.gatling.io/t/connection-getting-closed-to-jetty-server-websockets/1898>\
**Category:** Gatling (Open-Source)\
**Created:** [January 13, 2015, 8:34pm UTC](https://community.gatling.io/t/connection-getting-closed-to-jetty-server-websockets/1898 "2015-01-13T20:34:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Casey\_Patton](https://avatars.discourse-cdn.com/v4/letter/c/7ab992/32.png) [@Casey\_Patton](https://community.gatling.io/u/Casey_Patton)\
**Post date:** [January 13, 2015, 8:34pm UTC](https://community.gatling.io/t/connection-getting-closed-to-jetty-server-websockets/1898/1 "2015-01-13T20:34:16Z")

</div>

Currently trying to send a request to my server from Gatling to log-in. I used recorder.sh to create the simulation, and this worked just fine. However, when I try to run it, I’m getting the following error on Gatling:

14:58:15.862 [WARN] i.g.h.a.AsyncHandlerActor - Request ‘request\_21 Redirect 2’ failed: java.io.IOException: Remotely closed

On the server side, I’m getting:

> WARN [2015-01-13 15:25:18,722] [qtp2139493462-131] org.eclipse.jetty.websocket.WebSocketConnectionRFC6455 - Close: 1002 Not masked
> 
> WARN [2015-01-13 15:25:18,723] [qtp2139493462-131] org.eclipse.jetty.websocket.WebSocketConnectionRFC6455 - Close: 1002 Not masked
> 
> WARN [2015-01-13 15:25:18,724] [qtp2139493462-131] org.eclipse.jetty.websocket.WebSocketParserRFC6455 - Fragmented Control from SCEP@6993baa9{l(/127.0.0.1:60093)\<-\>r(/127.0.0.1:3301),d=true,open=true,ishut=false,oshut=true,rb=false,wb=false,w=true,i=1r}-{WebSocketServletConnectionRFC6455 p=WebSocketParserRFC6455@36049b80 state=OPCODE buffer=
> 
> Accept: _/_
> 
> Content-Type: application/x-www-form-urlencoded; charset=UTF-8
> 
> Accept-Language: en-US,en;q=0.5
> 
> Accept-Encoding: gzip, deflate
> 
> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:25.0) Gecko/20100101 Firefox/25.0
> 
> Referer: [http://localhost:3301/app/pt.pg.login.userpass;jsessionid=z10imh6n1ctg1nx2vvt1i056z](http://localhost:3301/app/pt.pg.login.userpass;jsessionid=z10imh6n1ctg1nx2vvt1i056z)
> 
> Cookie: JSESSIONID=z10imh6n1ctg1nx2vvt1i056z
> 
> Host: localhost:3301
> 
> g=WebSocketGeneratorRFC6455@687d0c34 closed=true buffer=-1}
> 
> WARN [2015-01-13 15:25:18,724] [qtp2139493462-131] org.eclipse.jetty.websocket.WebSocketConnectionRFC6455 - Close: 1002 Fragmented control
> 
> WARN [2015-01-13 15:25:18,724] [qtp2139493462-131] org.eclipse.jetty.websocket.WebSocketParserRFC6455 - Fragmented Control from SCEP@6993baa9{l(/127.0.0.1:60093)\<-\>r(/127.0.0.1:3301),d=true,open=true,ishut=false,oshut=true,rb=false,wb=false,w=true,i=1r}-{WebSocketServletConnectionRFC6455 p=WebSocketParserRFC6455@36049b80 state=OPCODE buffer=
> 
> Content-Type: application/x-www-form-urlencoded; charset=UTF-8
> 
> Accept-Language: en-US,en;q=0.5
> 
> Accept-Encoding: gzip, deflate
> 
> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:25.0) Gecko/20100101 Firefox/25.0
> 
> Referer: [http://localhost:3301/app/pt.pg.login.userpass;jsessionid=z10imh6n1ctg1nx2vvt1i056z](http://localhost:3301/app/pt.pg.login.userpass;jsessionid=z10imh6n1ctg1nx2vvt1i056z)
> 
> Cookie: JSESSIONID=z10imh6n1ctg1nx2vvt1i056z
> 
> Host: localhost:3301

I have to admit that I don’t really understand what’s happening. Something about websockets…are these not supported by Gatling? Is there a work-around for this?

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [January 13, 2015, 8:55pm UTC](https://community.gatling.io/t/connection-getting-closed-to-jetty-server-websockets/1898/2 "2015-01-13T20:55:02Z")

</div>

The Recorder doesn’t support WebSockets atm, only the load engine does.  
Some initial pre-handshake/upgrade requests might have sneaked in and should be removed. Could you share an example, please?

---

<div class="post-metadata">

**Author:** ![Casey\_Patton](https://avatars.discourse-cdn.com/v4/letter/c/7ab992/32.png) [@Casey\_Patton](https://community.gatling.io/u/Casey_Patton)\
**Post date:** [January 13, 2015, 9:04pm UTC](https://community.gatling.io/t/connection-getting-closed-to-jetty-server-websockets/1898/3 "2015-01-13T21:04:40Z")

</div>

Hey Stéphane,

Thanks for the response!  
So I’d need to write my own scala simulation script by hand using web sockets in order to connect to a jetty server is the idea? Or would that not work? What are you looking for an example of?

-Casey

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [January 13, 2015, 9:12pm UTC](https://community.gatling.io/t/connection-getting-closed-to-jetty-server-websockets/1898/4 "2015-01-13T21:12:43Z")

</div>

I mean that if your application involves websocket traffic, this one has to be manually crafted, yes. But the regular HTTP traffic is fine. This is nothing specific to Jetty.
