Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot advertise WebTransport with externally known addresses (external static IP + port forwarding, dns, etc.) #2223

Closed
aschmahmann opened this issue Mar 26, 2023 · 2 comments · Fixed by #2239
Assignees

Comments

@aschmahmann
Copy link
Collaborator

When running a go-libp2p host behind a NAT with port forwarding enabled or another environment where the user might know more about the addresses to advertise than go-libp2p has been able to discover (e.g. DNS addresses) users pass in their addresses via the AddrsFactory option

func AddrsFactory(factory config.AddrsFactory) Option {

As I understand it the AddrsFactory takes in the list of addresses that go-libp2p thinks it should be advertising and then allows the user to modify that list (e.g. override/remove elements, add new ones, etc.). The multiaddrs processed and returned by this function are ones that do not have the /p2p/<peerID> suffix.

Unfortunately, this behavior doesn't work for WebTransport since naively adding an additional /ip4/1.2.3.4/udp/1234/quic-v1/webtransport will be broken due to the lack of WebTransport certificates that are not added internally by go-libp2p. This is not something the user can reasonably deal with by passing the certificates themselves without understanding (and replicating) the internal go-libp2p mechanism for managing WebTransport certificates (having deterministic certificates generated with timestamps based on dividing time into fixed intervals) or finding some awkward workaround (e.g. having a loopback webtransport listener and then reading the certificates go-libp2p has emitted for the loopback listener and feeding it back into the AddrsFactory).

@BigLep
Copy link
Contributor

BigLep commented Mar 27, 2023

@p-shahi : I know I missed go-libp2p triage. Was this discussed at all? Given it's relevant for IPFS Thing demos, I wanted to set expectations for people on whether it will get picked up soon or not.

https://filecoinproject.slack.com/archives/C03FFEVK30F/p1679935514021119

@MarcoPolo
Copy link
Collaborator

We didn't talk about this. Both prithvi and I were a bit sick so we concluded. early. I can tal now.

@MarcoPolo MarcoPolo self-assigned this Mar 27, 2023
@aschmahmann aschmahmann changed the title Cannot advertise WebTransport with externally known addresses (port forwarding, dns, etc.) Cannot advertise WebTransport with externally known addresses (external static IP + port forwarding, dns, etc.) Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment