Bug 1369533

Summary: Client's IP when accessing via ws protocol not accessible to NodeJS application
Product: OpenShift Online Reporter: Mirano Tuk <mirano.tuk>
Component: RoutingAssignee: Ben Bennett <bbennett>
Status: CLOSED DUPLICATE QA Contact: zhaozhanqi <zzhao>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.xCC: aos-bugs, rthrashe
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-26 20:02:51 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:

Description Mirano Tuk 2016-08-23 16:44:05 UTC
Description of problem:
NodeJS server doesn't seem to be able to access client's IP address when using websocket protocol.

Given a NodeJS server:

    let ws = require("ws");
    let server = new ws.Server({host: process.env.OPENSHIFT_NODEJS_IP, port: 8080});

    server.on('connection', function connection(conn) {
        console.log(conn.upgradeReq.headers);
    });

Following headers are logged:
    connection, upgrade, sec-websocket-version, sec-websocket-key, origin, host
    Host header contains reverse proxy's ip:port, x-forwarded-for header is missing.

Comment 1 Rory Thrasher 2016-08-26 20:02:51 UTC
Hi Mirano,

We've recently merged a fix for this, it should be rolled out to OpenShift Online soon.  

For now, I'm going to close this in favor of the duplicate bug.  If you are still seeing this problem in a week or so, please comment on the duplicate bugzilla.

Thanks.

*** This bug has been marked as a duplicate of bug 1313395 ***