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

feat: add webrtc-direct support #42

Closed
wants to merge 1 commit into from
Closed

Conversation

aschmahmann
Copy link
Contributor

No description provided.

)

func libp2pHost() (host.Host, error) {
h, err := libp2p.New(libp2p.DefaultMuxers, libp2p.Muxer("/mplex/6.7.0", mplex.DefaultTransport), libp2p.EnableHolePunching())
h, err := libp2p.New(libp2p.DefaultTransports, libp2p.Transport(libp2pwebrtc.New), libp2p.DefaultMuxers, libp2p.Muxer("/mplex/6.7.0", mplex.DefaultTransport), libp2p.EnableHolePunching())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarcoPolo any downsides here? This will disable listen addresses, but that seems fine (even though it'll prevent dialbacks if the node is publicly reachable). Perhaps we should even have been doing that explicitly or enabling the user to pass a listen address if they want dialbacks to work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might break hole-punching too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would this break hole-punching?

Isn't this a problem then now that we have webrtc enabled by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that adding a transport will disable the default listen addresses so we'd have to pass them in manually (of course still very doable) and the lack of listen addresses would cause problems with the holepunching.

@aschmahmann
Copy link
Contributor Author

WebRTC Direct is enabled by default in go-libp2p so this will be replaced by #45

@aschmahmann aschmahmann closed this Aug 6, 2024
@2color 2color deleted the feat/add-webrtcdirect branch August 6, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants