I have confirmed that the websocket upgrade headers are set here:
https://github.com/openshift/origin-server/blob/master/node-proxy/lib/proxy/ProxyServer.js#L458-L469
As you can see, the upgrade request headers are not inherited, which is why user-agent is not showing up, and the X-Forwarded-For and X-Client-IP headers are not being set. We probably want something like:
var zheaders = { 'headers': {}};
zheaders.headers['user-agent'] = upgrade_req.headers['user-agent'];
/* Set X-Forwarded-For HTTP extension header. */
var xff = upgrade_req.connection.remoteAddress ||
upgrade_req.socket.remoteAddress;
zheaders.headers['X-Forwarded-For'] = xff;
/* Set X-Client-IP HTTP extension header. */
zheaders.headers['X-Client-IP'] = xff;
/* Pass down the cookie, if any */
...

QA, the same instructions for the enterprise version can be used to test this.
Please follow the below steps to test the fix for this bug:
1) Create a diy application using the application code found at https://github.com/tiwillia/SimpleDIYPrintHeaders.git
$ rhc app-create websockettest diy --from-code https://github.com/tiwillia/SimpleDIYPrintHeaders.git
[...]
URL: http://websockettest1-tiwillia.dev.rhcloud.com/
[...]
2) Create a websocket connection to the application on port 8000. You can do this any way you'd like, but I found this to be the easiest:
4a) Install and use the wscat tool:
$ npm install wscat
$ ~/node_modules/wscat/bin/wscat --connect ws://websockettest1-tiwillia.dev.rhcloud.com
OR
4b) Copy the following into a file on your local machine and open the file in your browser of choice:
<!doctype html>
<html lang="en">
<head>
<title>Websocket Client</title>
</head>
<body>
<script>
console.log("I'm trying to connect!");
var exampleSocket = new WebSocket("ws://websockettest1-tiwillia.dev.rhcloud.com:8000");
exampleSocket.onopen = function (event) {
console.log("Connected!");
};
</script>
</body>
</html>
3) `rhc tail` the logs of the app as the connection is made or view the logs afterwards. The headers the application receives during the inital connection will be printed to the application logs. Verify that the user-agent, X-Forwarded-For, and X-Client-IP headers are recorded in the logs.
Please let us know if there are any questions.

We apologize, however, we do not plan to address this report at this time. The majority of our active development is for the v3 version of OpenShift. If you would like for Red Hat to reconsider this decision, please reach out to your support representative. We are very sorry for any inconvenience this may cause.

Note

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