ipfs / ipfs/kubo

[bug] TCP tunnel breaks after every request

Open
#5,032 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

==============Server side, firewall only open TCP 4001=========
$ ipfs version
ipfs version 0.4.15

$ ipfs id
"ID": [my vps ipfs id]
$ ipfs p2p listener open p2p-test /ip4/127.0.0.1/tcp/8081
{"Address":"/ip4/127.0.0.1/tcp/8081","Protocol":"/p2p/p2p-test"}

$ curl --socks5 127.0.0.1:8081 http://myip.ipip.net
IP:[my vps wan ip] amazon.com

==================Client side, symmetric NAT===========
$ ipfs version
ipfs version 0.4.15

$ ipfs p2p stream dial [my vps ipfs id] p2p-test /ip4/127.0.0.1/tcp/10102
{"Address":"/ip4/127.0.0.1/tcp/10102","Protocol":"/p2p/p2p-test"}

$ ipfs p2p stream dial [my vps ipfs id] p2p-test /ip4/127.0.0.1/tcp/10102
Error: listen tcp4 127.0.0.1:10102: bind: address already in use

$ curl --socks5 127.0.0.1:10102 http://myip.ipip.net
IP:[my vps wan ip] amazon.com

$ curl --socks5 127.0.0.1:10102 http://myip.ipip.net
curl: (7) Failed to connect to 127.0.0.1 port 10102: Connection refused

$ ipfs p2p stream dial [my vps ipfs id] p2p-test /ip4/127.0.0.1/tcp/10102
{"Address":"/ip4/127.0.0.1/tcp/10102","Protocol":"/p2p/p2p-test"}

$ curl --socks5 127.0.0.1:10102 http://myip.ipip.net
IP:[my vps wan ip] amazon.com

$ curl --socks5 127.0.0.1:10102 http://myip.ipip.net
curl: (7) Failed to connect to 127.0.0.1 port 10102: Connection refused

$ ipfs p2p stream dial [my vps ipfs id] p2p-test /ip4/127.0.0.1/tcp/10102
{"Address":"/ip4/127.0.0.1/tcp/10102","Protocol":"/p2p/p2p-test"}

$ curl --socks5 127.0.0.1:10102 http://myip.ipip.net
IP:[my vps wan ip] amazon.com

$ curl --socks5 127.0.0.1:10102 http://myip.ipip.net
curl: (7) Failed to connect to 127.0.0.1 port 10102: Connection refused

....

What a pity, TCP tunnel breaks after every request.

https://github.com/ipfs/go-ipfs/issues/3397#issuecomment-309306293

Contributor guide

Open the contributing guide

Research direction

Start with the `ipfs p2p stream dial` and `curl --socks5` entry points shown in the report, reproducing the sequential-request failure on version 0.4.15. Trace why the local TCP listener is refused after the first request; done means the same tunnel accepts repeated requests without requiring another dial.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.