0

I have a simple web app, which is using websockets. simple webapp: Frontend - using sockjs, stomp Backend - Spring 4.2.x

Frontend & Backend are packaged in the same WAR, this WAR is deployed on IBM WebSphere Application Server v9.x

When I check the Developer Tools/Web Console in chrome(61.x)/firefox(56.0, 32 bit), I see that websocket transport is not being used, it's always xhr streaming. To use the websocket transport, I have passed the transports option in sockjs, like below, but after this change the websockets stopped working.

var sockjs = new SockJS(my url, null, {transports: ["websocket"]});

Do we need to change any configuration on IBM WebSphere Application Server v9.x to enable websocket transport ?

Update: on tomcat/liberty servers, sample app always uses websocket transport. Only on WAS, it is using xhr streaming. Issue in WAS?

aryanRaj_kary
  • 503
  • 2
  • 7
  • 28

1 Answers1

0

Websocket protocol handling is on by default for Websphere v9.x

covener
  • 17,402
  • 2
  • 31
  • 45
Bill_W_71
  • 26
  • 2
  • Is there any sample code from IBM using which I can test websocket transport on WAS, or is it the browser that decides the transport ? – aryanRaj_kary Oct 25 '17 at 14:38
  • Ideas: 1) WebSphere implements websockets to the standard websocket spec, so any spec compliant "Hello World" app should run ok. 2) https://developer.ibm.com/wasdev/downloads/#asset/samples-WebSocket_Sample. The instructions are for WebSphere Liberty but straightforward to use the war in WebSphere Application Server V9.x 3) github samples: https://github.com/WASdev/sample.async.websockets 4) WebSphere Liberty has an app accelerator you can use to build a war for a WebSocket program on WebSphere Application Server V9.x: https://liberty-app-accelerator.wasdev.developer.ibm.com/start/ – Bill_W_71 Oct 25 '17 at 17:12
  • sample app works, but not sure why it uses xhr streaming always. – aryanRaj_kary Oct 26 '17 at 02:36
  • on tomcat/liberty the sample app uses websocket transport, but only on WAS it is using xhr streaming, looks like an issue in WAS. – aryanRaj_kary Nov 06 '17 at 03:56