Bug 1031986 - openshift-node-web-proxy doesn't pass protocol specified by client on websockets requests
openshift-node-web-proxy doesn't pass protocol specified by client on websock...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
high Severity high
: ---
: ---
Assigned To: Mrunal Patel
libra bugs
:
Depends On:
Blocks: 1034134
  Show dependency treegraph
 
Reported: 2013-11-19 05:14 EST by Johnny Liu
Modified: 2015-05-14 19:32 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1034134 (view as bug list)
Environment:
Last Closed: 2014-01-23 22:33:49 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
server.js (2.36 KB, application/javascript)
2013-11-20 01:13 EST, Johnny Liu
no flags Details
client.js (1.09 KB, application/javascript)
2013-11-20 01:14 EST, Johnny Liu
no flags Details

  None (edit)
Description Johnny Liu 2013-11-19 05:14:45 EST
Description of problem:
Fail to access websocket of app, but could access it by internal IP. Seem like openshift-node-web-proxy doesn't pass protocol specified by client to app's node process.

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

How reproducible:
Always

Steps to Reproduce:
1.Create nodejs-0.10 app.
2.Use attachment to replace server.js
3.Add "websocket" to package.json
  "dependencies": {
    "websocket": ">= 1.0.7"
  },
4. Then git push
5. On client, access websocket of your app.


Actual results:
# node client.js ws://nodejs010app-jialiu.dev.rhcloud.com:8000/
Connecting to ws://nodejs010app-jialiu.dev.rhcloud.com:8000/
WebSocket client connected
echo-protocol Connection Closed

Seen from app's log, get the following error:
<--snip-->
! requestedProtocols should be 'echo-protocol'
! requestedProtocols is: 
Failed to accept connection: Error: Specified protocol was not requested by the client.
<--snip-->

Seem like openshift-node-web-proxy doesn't pass protocol specified by client to app's node process.


Expected results:
Websocket should be accessed successfully.

Additional info:
Succeed to access app's websokect via internal IP directly.

# node client.js ws://127.1.244.1:8080/
Comment 1 Johnny Liu 2013-11-19 06:41:16 EST
Looks like this is a regression bug, because BZ#1002070 is using the same test stips and it is fixed in devenv-stage_471
Comment 2 Johnny Liu 2013-11-20 01:13:44 EST
Created attachment 826443 [details]
server.js
Comment 3 Johnny Liu 2013-11-20 01:14:19 EST
Created attachment 826444 [details]
client.js
Comment 4 Mrunal Patel 2013-11-21 13:04:45 EST
We need to port our patches to nodejs-ws to nodejs010-nodejs-ws.
Comment 5 Mrunal Patel 2013-11-21 19:54:12 EST
Waiting for nodejs010-nodejs-ws-0.4.25-8.el6oso to be available in devenv/stg.
Comment 7 chunchen 2013-11-24 21:57:35 EST
It's reproduced, checked on devenv_4067, the nodejs010-nodejs-ws version is 0.4.25-8.el6oso.x86_64. Please refer to the following results:

1.Create nodejs-0.10 app
rhc app create cndjs10 nodejs-0.10
2.Use the attachment to replace server.js and add client.js
3.Add "websocket" to package.json
  "dependencies": {
    "websocket": ">= 1.0.7"
  },
4. Push the changes
git add .; git commit -amp; git push
5. SSH into this app and access websocket
rhc ssh cndjs10
cd ~/app-root/runtime/repo

\> node client.js ws://cndjs10-cdm.dev.rhcloud.com:8000/
Connecting to ws://cndjs10-cdm.dev.rhcloud.com:8000/
WebSocket client connected
echo-protocol Connection Closed
Comment 8 Johnny Liu 2013-11-25 03:47:17 EST
Verified this bug against devenv_4067, and PASS.

# rpm -qa|grep nodejs010-nodejs-ws
nodejs010-nodejs-ws-0.4.25-8.el6oso.x86_64

[jialiu@jialiu-pc1 nodejs010app]$ node client.js ws://nodejs010app-jialiu.dev.rhcloud.com:8000/
Connecting to ws://nodejs010app-jialiu.dev.rhcloud.com:8000/
WebSocket client connected
Received: '8833312'
Received: '13763515'
Received: '14992830'
Received: '6033139'
Received: '14016768'
Received: '6773515'
Received: '1969944'

App log:
Mon Nov 25 2013 03:10:49 GMT-0500 (EST) Server is listening on port 8080
! requestedProtocols should be 'echo-protocol'
! requestedProtocols is: echo-protocol
Mon Nov 25 2013 03:11:16 GMT-0500 (EST) Connection accepted.
Received Message: 10356115
Received Message: 16628742
Received Message: 1098512
Received Message: 13707152
Received Message: 521087
Received Message: 795350
Mon Nov 25 2013 03:11:22 GMT-0500 (EST) Peer 127.1.244.1 disconnected.


About the failure in comment 7, actually it is another issue, file BZ#1034077 for more details.

Note You need to log in before you can comment on or make changes to this bug.