-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: Add WebSocket and WebRTC transports to relay server example #6030
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @r-zig. Some high-level comments, but please see #6029 (comment) for the general discussion.
@@ -0,0 +1 @@ | |||
RUST_LOG=info cargo run -- --port 4884 --secret-key-seed 0 --websocket-port 8080 --webrtc-port 8081 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate the effort, but I don't think we should add run scripts that hard-code the parameters. Most user want to change these parameters anyway, and having to think about them IMO also helps the general understanding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I will move them to a new repo that provide examples.
examples/relay-server/Cargo.toml
Outdated
libp2p-webrtc = { workspace = true, features = ["tokio"] } | ||
libp2p-noise = { workspace = true } | ||
libp2p-tls = { workspace = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use them through the libp2p
meta crate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the tls & noise , but webrtc is not exposed via the libp2p meta crate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, but have webrtc-direct been tested while being used as a relay recently? Not sure if there have been any recent changes but during my testing, I ran into an issue. See #5453. Could you please confirm?
Description
This PR addresses issue #6029 by adding WebSocket and WebRTC transport support to the relay server example.
While full WebRTC interoperability is not yet supported, these changes lay the groundwork for ongoing efforts to enable and test connectivity between peers behind different private NATs and VPNs.
This work is particularly relevant for use cases involving interoperability with other libp2p implementations, such as js-libp2p-example-webrtc-private-to-private, and is a step toward seamless connectivity between browser-based JS peers, Rust processes, and both Rust and JS relays.
Related:
libp2p/js-libp2p-examples#226.
libp2p/js-libp2p-examples#227.
Draft: WebRTC Implementation for Browser to Browser #5978
Fixes: libp2p/rust-libp2p#6029.
Notes & open questions
Change checklist