Bug 1369533 - Client's IP when accessing via ws protocol not accessible to NodeJS application
Summary: Client's IP when accessing via ws protocol not accessible to NodeJS application
Keywords:
Status: CLOSED DUPLICATE of bug 1313395
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Routing
Version: 2.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Ben Bennett
QA Contact: zhaozhanqi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-23 16:44 UTC by Mirano Tuk
Modified: 2016-08-26 20:02 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-26 20:02:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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 ***


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