libp2p / libp2p/go-libp2p

Reachability of nodes is `Private` when using `ShareTCPListener`

Open
#3,336 0 comments 0 reactions 1 assignee View on GitHub

@sukunrt is already working on this.

Since Jul 21, 2025.

Dominant language
Go
Stars
6.9k
Forks
1.3k
Avg merge
13d 21h
Merged PRs (30d)
1

Description

As the title says, nodes that have `ShareTCPListner` report private reachability. The other nodes in the cluster are public. Same config, same everything.

```go
transports := []libp2p.Option{
libp2p.Transport(tcp.NewTCPTransport, tcp.DisableReuseport()),
libp2p.ShareTCPListener(), // <---- New change
}
if o.EnableWS {
transports = append(transports, libp2p.Transport(ws.New))
}
opts = append(opts, transports...)

var listenAddrs []string
listenAddrs = append(listenAddrs, fmt.Sprintf("/ip4/%s/tcp/%s", ip4Addr, port))
if o.EnableWS {
listenAddrs = append(listenAddrs, fmt.Sprintf("/ip4/%s/tcp/%s/ws", ip4Addr, port))
}
opts = append(opts, libp2p.ListenAddrStrings(listenAddrs...))
...
```

Reachability is private with or without ws.

version: v0.42.0

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.