libp2p / libp2p/go-libp2p

websocket: record X-Real-IP header

Open
#1,437 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

exp/expert good first issue help wanted kind/enhancement
Dominant language
Go
Stars
6.9k
Forks
1.3k
Avg merge
13d 21h
Merged PRs (30d)
1

Description

We currently don't support TLS here, so a reverse proxy needs to be set up, which has the side effect of loosing real ip addresses in `ipfs swarm peers`.

We could check if the `X-Real-IP` header is set when accepting connections and change the ip address we report as the remote (and probably only do that when we proxy from localhost)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating where websocket connections are accepted and where the remote address reported by `ipfs swarm peers` is derived. Review how `X-Real-IP` would be trusted when proxying from localhost, then define tests for connections with and without the header. Done means the reported address preserves the real client IP only under the intended proxy conditions.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.