title: Vaadin cannot establish Websocket connection on OpenShift
body: <p>I'm using Vaadin 7.3 with Tomcat8 (built manually from sources on the server) on the OpenShift server. My other setup is Tomcat7 7.0.54 also on OpenShift. My problem appears on both those configurations.
  Here's what happens: while I'm opening my Vaadin application with the @Push support enabled, I get the following error:</p>
  
  <pre><code>WebSocket connection to 'ws://t8-drewconnect.rhcloud.com/web/PUSH/?v-uiId=0&amp;v-csrfToken=4097664e-4d3b-4dd6-9474-0a6441986e9a&amp;X-Atmosphere-tracking-id=0&amp;X-Atmosphere-Framework=2.1.5.vaadin4-jquery&amp;X-Atmosphere-Transport=websocket&amp;X-Atmosphere-TrackMessageSize=true&amp;X-Cache-Date=0&amp;Content-Type=application/json;%20charset=UTF-8&amp;X-atmo-protocol=true' failed: Error during WebSocket handshake: Unexpected response code: 501 
  ​Websocket closed, reason: Connection was closed abnormally (that is, with no close frame being sent). vaadinPush.debug.js:13176
  Websocket closed, wasClean: false vaadinPush.debug.js:13176
  Mon Sep 22 07:39:46 GMT+200 2014 com.vaadin.client.VConsole
  INFO: Push connection closed com.drewconnect.web.AppWidgetSet-0.js:4714
  Websocket failed. Downgrading to Comet and resending vaadinPush.debug.js:13176
  Mon Sep 22 07:39:46 GMT+200 2014 com.vaadin.client.VConsole
  INFO: Push connection using primary method (websocket) failed. Trying with long-polling 
  </code></pre>
  
  <p>I have spent good amount of time reading on the web, what can be done about it, read about enabling native atmosphere support etc. and was about to configure it, when I discovered, that Vaadin uses Atmosphere bundled into atmosphere-runtime-2.1.2.vaadin3.jar, which I'm not sure if I can get rid of. This Atmosphere article <a href="https://github.com/Atmosphere/atmosphere/wiki/Installing-AtmosphereServlet-with-or-without-native-support" rel="nofollow">https://github.com/Atmosphere/atmosphere/wiki/Installing-AtmosphereServlet-with-or-without-native-support</a> suggests using atmosphere-runtime-native but it looks like Vaadin uses some customised version...</p>
  
  <p>Strangely on the localhost (in my dev environment) the WebSockets connection is being established without any problems...</p>
  
  <p>Am I on a good way to fix the problem or am I somewhere completely else? ;-) Do you guys know the solution to this problem?
  I would appreciate the answer, because negotiation between websockets and long-polling takes a lot of time - I have to wait for about 2 minutes before the application reacts, and sometime it never finishes (at the top of the screen there's a blinking progress bar, which never gets to 100%). 
  My customer, I've presented the demo of the application to, cannot connect in 9 out of 10 cases and so I'm completely stuck - without seeing the demo he won't go any further with me ;(</p>