Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

req.connection.remoteAddress doesn't return real client ip behind proxies #942

@sh

Description

@sh

We're using trace-agent for connect + express in pods behind a loadbalancer, the value of /http/source/ip is always the ip of the loadbalancer instead of the real client.

This makes debugging individual issues based on the /http/source/ip currently impossible.

Using req.ip instead of req.connection.remoteAddress for express and koa would respect any x-forwarded-for headers and report the real client ip.

API

Docs

I'd happily contribute a pull request for this :)

Metadata

Metadata

Assignees

Labels

api: cloudtraceIssues related to the googleapis/cloud-trace-nodejs API.help wantedWe'd love to have community involvement on this issue.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions