Bug 1123033

Summary: Can not connect to Websocket on Openshift, works fine locally
Product: OpenShift Online Reporter: Harit Himanshu <harit.subscriptions>
Component: MasterAssignee: Lili Nader <lnader>
Status: CLOSED WORKSFORME QA Contact: libra bugs <libra-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.xCC: jokerman, mfisher, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-24 19:50:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Harit Himanshu 2014-07-24 16:39:24 UTC
Description of problem:
I have a project https://github.com/hhimanshu/tweetstream where I connect to server using websocket, see https://github.com/hhimanshu/tweetstream/blob/master/src/main/webapp/tweets.js#L19. This works fine when I run it locally on my laptop, but I see error when deployed to Openshift

I even tried port :8000, but no luck
var connection = new WebSocket('wss://'+ document.location.host + ':8000' + document.location.pathname + 'tweets');
  connection.onopen = function() {
  connection.onerror = function(error) {
    console.log('WebSocket Error ' + error);
  connection.onmessage = function(e) {
    var parse = JSON.parse(e.data);
    var coordinates = parse["geo"]["coordinates"];
    console.log("coordinates:" + JSON.stringify(coordinates, undefined, 2));

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. load app in browser http://map-tweetstream.rhcloud.com/
2. See console log for error
WebSocket connection to 'ws://map-tweetstream.rhcloud.com/tweets' failed: Error during WebSocket handshake: Unexpected response code: 404 tweets.js:19
WebSocket Error [object Event] 

Actual results:

Expected results:

Additional info: