Bug 1002070
Summary: | ProxyServer doesn't pass Sec-WebSocket-Protocol on websockets requests | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | OpenShift Online | Reporter: | Marek Schmidt <maschmid> | ||||||
Component: | Containers | Assignee: | Mrunal Patel <mpatel> | ||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | libra bugs <libra-bugs> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 2.x | CC: | bmeng, chunchen, mpatel, xtian | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2013-09-19 16:48:25 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: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Marek Schmidt
2013-08-28 12:38:49 UTC
Borrowing test case from the user reported issue on forum (https://www.openshift.com/forums/openshift/websockets-with-nodejs) - 1. Create a nodejs application. 2. Copy over server.js and package.json from https://github.com/jasonish/openshift-node-websocket 3. Modify server.js to use OPENSHIFT_NODEJS_IP instead of OPENSHIFT_INTERNAL_IP (same for PORT). 4. git push your changes. 5. Use the client.js from https://github.com/jasonish/openshift-node-websocket to test the server node client.js ws://app-ns.dev.rhcloud.com:8000/ 6. Verify the client keeps on getting data till it is stopped. (Without the fix, the client connection is immediately closed as the server expects to see Sec-Websocket-Protocol as "echo-server". Tested on devenv_3776 with steps in comment#2, The connection will closed immediately. \> node client.js ws://no1-bmengdev.dev.rhcloud.com:8000/ Warning: Native modules not compiled. XOR performance will be degraded. Warning: Native modules not compiled. UTF-8 validation disabled. Connecting to ws://no1-bmengdev.dev.rhcloud.com:8000/ WebSocket client connected echo-protocol Connection Closed Created attachment 796953 [details]
Package.json file for testing.
Created attachment 796954 [details]
Server.js file for testing.
I just retested and it worked for me. I have attached the package.json and server.js file that I used for testing this. (Ignore the native code compilation error for websocket module that doesn't affect this test case.). Also, to debug make sure the server is running after the push by tailing the ~/nodejs/logs/node.log Check on devenv-stage_471, it works well now. And maybe the last time I failed because I am connecting the server inside the app gear. # node client.js ws://no81-bmengdev.dev.rhcloud.com:8000/ Connecting to ws://no81-bmengdev.dev.rhcloud.com:8000/ WebSocket client connected Received: '739888' Received: '15523852' Received: '16017545' Received: '3351055' Received: '4459250' Received: '2018313' Received: '4521020' Received: '3021884' Received: '14880327' Received: '9231157' Received: '4399874' Received: '4083156' Received: '8176787' Received: '6908197' Received: '11015009' Received: '15859325' Received: '771345' Received: '11924669' Received: '16454520' Received: '15474892' Received: '8429852' Received: '2977346' Received: '12174073' Received: '12879463' Received: '4589779' Received: '3582465' Received: '3438632' Received: '10037830' Received: '10095069' Received: '15920846' |