Repository navigation
HTTP Routing V1 provider records contain raw 0.0.0.0 listen addresses instead of resolved interface addresses #11213
Description
Checklist
- This is a bug report, not a question. Ask questions on discuss.ipfs.tech.
- I have searched on the issue tracker for my bug.
- I am running the latest kubo version or have an issue updating.
Installation method
dist.ipfs.tech or ipfs-update
Version
## Version
## Installation method
npm (`kubo` package v0.40.0)
Kubo version: 0.40.0-882b7d2a9
Repo version: 18
System version: amd64/linux
Golang version: go1.26.0
Config
## Config
Default config from `ipfs init`, with only these changes:
- `Addresses.API` changed to avoid port conflicts
- `Addresses.Swarm` ports changed to avoid conflicts (still using `0.0.0.0` bind, which is the default)
- `Addresses.Gateway` disabled
- `Discovery.MDNS.Enabled` set to false
- Bootstrap peers removed
- `Routing` set to custom with a single HTTP router endpoint
{
"Routing": {
"Type": "custom",
"Methods": {
"find-providers": { "RouterName": "HttpRouter" },
"provide": { "RouterName": "HttpRouter" },
"find-peers": { "RouterName": "HttpRouter" },
"get-ipns": { "RouterName": "HttpRouter" },
"put-ipns": { "RouterName": "HttpRouter" }
},
"Routers": {
"HttpRouter": {
"Type": "http",
"Parameters": { "Endpoint": "http://127.0.0.1:<mock-router-port>" }
}
}
}
}Description
When Kubo sends provider records to an HTTP router via PUT /routing/v1/providers, the Addrs field in the request body contains the raw Addresses.Swarm listen addresses (e.g. /ip4/0.0.0.0/tcp/24199) instead of resolved interface addresses.
ipfs id correctly resolves 0.0.0.0 to actual network interface addresses, but the HTTP Routing V1 code path does not perform this resolution before sending provider records.
What I was doing
- Started a fresh Kubo node with default swarm config (
0.0.0.0bind addresses) - Configured
Routingto use an HTTP router (a local mock server that records requests) - Added content via
ipfs add - Triggered
ipfs routing provide <cid>
What I expected
The PUT /routing/v1/providers request sent to the HTTP router should contain resolved interface addresses, matching what ipfs id reports:
/ip4/192.168.x.x/tcp/24199
/ip4/172.17.0.1/tcp/24199
/ip4/127.0.0.1/tcp/24199
/ip4/192.168.x.x/udp/24199/quic-v1
...
What actually happened
The provider records sent to the HTTP router contain the raw unresolved listen addresses:
/ip4/0.0.0.0/tcp/24199
/ip6/::/tcp/24199
/ip4/0.0.0.0/udp/24199/quic-v1
/ip6/::/udp/24199/quic-v1
/ip4/0.0.0.0/udp/24199/quic-v1/webtransport
/ip6/::/udp/24199/quic-v1/webtransport
/ip4/0.0.0.0/udp/24199/webrtc-direct
/ip6/::/udp/24199/webrtc-direct
While at the same time, ipfs id correctly reports resolved addresses like /ip4/192.168.x.x/tcp/24199, /ip4/172.17.0.1/tcp/24199, etc.
Impact
Any client that discovers a provider via an HTTP router receives useless 0.0.0.0 addresses and must fall back to a DHT FIND_PEER to locate the actual peer, defeating the purpose of the HTTP router.
As a workaround we run a proxy server between Kubo and the HTTP router that intercepts PUT /routing/v1/providers requests and rewrites the addresses using data from the id and swarm/addrs API endpoints.
Steps to reproduce
Minimal reproduction repo: https://github.com/Rinse12/kubo-http-router-0.0.0.0-address-bug
git clone https://github.com/Rinse12/kubo-http-router-0.0.0.0-address-bug.git
cd kubo-http-router-0.0.0.0-address-bug
npm install
node index.mjsThe script starts a mock HTTP Routing V1 server, starts a fresh Kubo daemon pointing at it, adds content, triggers routing provide, and prints the addresses from ipfs id alongside the addresses Kubo actually sent to the HTTP router.
Activity
lidel commentedon Feb 27, 2026
Thank you for reporting.
Triage note:
The issue is in boxo's
routing/http/client.ClientProvideraddresses are captured once at client construction time viaWithProviderInfo(peerID, addrs)and stored as a static[]types.Multiaddrfield. WhenProvideBitswap()builds the request, it readsc.addrsdirectly:Kubo calls
WithProviderInfowith raw config strings fromAddresses.Swarm(viahttpAddrsFromConfig()), so0.0.0.0/::end up in provider records verbatim.The DHT provider path does not have this problem because it uses a
func() []ma.Multiaddrcallback that is evaluated at provide-time:Proposed fix in boxo
Add a callback-based alternative to
WithProviderInfoso addresses are resolved at provide-time, not construction-time. This follows the same pattern kubo's DHT provider already uses withWithSelfAddrs.1. New option in
routing/http/client/client.go:2.
ProvideBitswapresolves addresses lazily:That's the entire boxo change: one new field, one new option func, one helper method, one changed line in
ProvideBitswap.Kubo side
Once boxo exposes
WithProviderInfoFunc, kubo threadshost.Hostinto the HTTP router construction (it is already available inRoutingOptionArgs.Hostat that point) and provides a callback:This gives us:
WithProviderInfokeeps working as-is (no breaking change)Since this requires new boxo release, and is a bug in experimental opt-in feature, low priority, but we could ship this in 0.41 if someone submits a PR.
rayspock commentedon Mar 1, 2026
Hi, I’m new to the Kubo repo but I’ve been looking into this issue and the proposed direction seems reasonable.
From what I understand, HTTP Routing V1 provider records currently expose raw 0.0.0.0 listen addresses, and the goal would be to resolve these into actual interface addresses before returning them.
If no one is actively working on this, I’d be happy to take it on and put together a PR. Please let me know if there are any design constraints or preferred approaches I should be aware of before starting.
fix: resolve addresses from host for HTTP delegated routing
fix: resolve provider addresses dynamically for HTTP routing
lidel commentedon Mar 14, 2026
@Rinse12 are you able to test if
addresses your needs?
It uses confirmed public addrs from AutoNATv2 system, and also respects
Addresses.Announce(static override) andAddresses.AppendAnnounce(adding static addrs in addition to dynamic / Wwarm ones)Cripto5588 commentedon Mar 16, 2026
lidel commentedon Mar 16, 2026
fix: correct provider addresses for custom HTTP routing (ipfs#11234)
Rinse12 commentedon Apr 24, 2026
I just tested it on Kubo 0.41.0 and unfortunately it still announces 0.0.0.0 addresses.
You can test it out on https://github.com/Rinse12/kubo-http-router-0.0.0.0-address-bug
lidel commentedon Apr 24, 2026
@Rinse12 i suspect this is due to you not running libp2p DHT and/or AutoNAT? You really should consider enabling DHT, not doing so is bit counter-productive, especially with recent improvements (provide sweep, strategy
pinned+mfs+uniqueetc).Update:
Addresses.Swarmstrings verbatim, so/ip4/0.0.0.0/...goes through untouched.Addresses.NoAnnounceCIDR filtering applies correctly. Targeting Kubo 0.42.Workaround until 0.42
Set
Addresses.Announceexplicitly to the address(es) you want in provider records (include all transports you use):Rinse12 commentedon Apr 26, 2026
Correct we're not using them intentionally. We would like to keep our apps very light in terms of network and computing resources with less moving parts involving IPFS. We've had issues with DHT in past, while they're probably fixed by now but we wanna get an MVP out with only http routers for now, then eventually explore http routers + DHT setup for backup.
Feel free to try out one of our apps bitsocial-cli.
fix: resolve wildcard swarm in http provides (#11297)
refactor(pkc): remove address rewriter proxy (no longer needed with k…