Bug 1361306
Summary: | Unable to obtain user-agent or client IP in websocket handshake on OpenShift hosted WildFly | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | Rory Thrasher <rthrashe> |
Component: | Networking | Assignee: | Rory Thrasher <rthrashe> |
Networking sub component: | router | QA Contact: | zhaozhanqi <zzhao> |
Status: | CLOSED ERRATA | Docs Contact: | |
Severity: | low | ||
Priority: | low | CC: | agrimm, aos-bugs, erich, gpei, jialiu, jkaur, jokerman, mmccomas, tiwillia, zzhao |
Version: | 2.2.0 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | openshift-origin-node-proxy-1.26.3.1-1.el6op | Doc Type: | Bug Fix |
Doc Text: |
Cause: In the websocket handshake, several headers were not being passed through the node's proxy.
Consequence: Applications who depended on the information in the user-agent, X-Forwarded-For, and X-Client-IP headers were not receiving the values of those headers.
Fix: The node proxy is now configured to properly send these headers in websocket connections.
Result: The user-agent, X-Forwarded-For, and X-Client-IP headers have proper values set that are available to the application
|
Story Points: | --- |
Clone Of: | 1313395 | Environment: | |
Last Closed: | 2016-08-24 19:47:05 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: | |||
Bug Depends On: | 1313395 | ||
Bug Blocks: |
Comment 4
Johnny Liu
2016-08-12 08:04:07 UTC
Verify this bug with OpenShiftEnterpriseErrata/2.2/2016-08-16.1, and PASS. Following comment 5, get the following result: a). # ~/node_modules/wscat/bin/wscat --connect ws://websockettest-jialiu.ose22-auto.com.cn:8000 # tailf /var/log/openshift_gears Aug 22 10:16:19 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 Incoming Request Aug 22 10:16:19 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 HTTP REQUEST: GET / HTTP/1.1 Aug 22 10:16:19 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 Connection: Upgrade Aug 22 10:16:19 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 Upgrade: websocket Aug 22 10:16:19 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 Sec-WebSocket-Version: 13 Aug 22 10:16:19 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 Sec-WebSocket-Key: MTMtMTQ3MTgzMjE3OTYwNw== Aug 22 10:16:19 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 user-agent: undefined Aug 22 10:16:19 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 X-Forwarded-For: 10.72.5.41 Aug 22 10:16:19 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 X-Client-IP: 10.72.5.41 Aug 22 10:16:19 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 Host: 127.7.107.1:8080 Aug 22 10:16:19 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 Websocket handshake detected with key: MTMtMTQ3MTgzMjE3OTYwNw== b). Create the following html test file: $ cat test.html <html lang="en"> <head> <title>Websocket Client</title> </head> <body> <script> console.log("I'm trying to connect!"); var exampleSocket = new WebSocket("ws://websockettest-jialiu.ose22-auto.com.cn:8000"); exampleSocket.onopen = function (event) { console.log("Connected!"); }; </script> </body> </html> Access this file from local browser, get the following log from /var/log/openshift_gears Aug 22 10:18:27 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 Incoming Request Aug 22 10:18:27 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 HTTP REQUEST: GET / HTTP/1.1 Aug 22 10:18:27 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 Connection: Upgrade Aug 22 10:18:27 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 Upgrade: websocket Aug 22 10:18:27 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 Sec-WebSocket-Version: 13 Aug 22 10:18:27 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 Sec-WebSocket-Key: MTMtMTQ3MTgzMjMwNzIzNQ== Aug 22 10:18:27 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 user-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Aug 22 10:18:27 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 X-Forwarded-For: 10.72.5.41 Aug 22 10:18:27 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 X-Client-IP: 10.72.5.41 Aug 22 10:18:27 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 Origin: null Aug 22 10:18:27 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 Host: 127.7.107.1:8080 Aug 22 10:18:27 node2 diy[917]: app=websockettest ns=jialiu appUuid=57ba5e0282611df8f20000dc gearUuid=jialiu-websockettest-1 Websocket handshake detected with key: MTMtMTQ3MTgzMjMwNzIzNQ== Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2016-1773.html |