-
Notifications
You must be signed in to change notification settings - Fork 204
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
Tracking: WebAssembly support for iroh #2799
Comments
Thanks for the blogspot, and about relay servers. Will Ockam be helpful in end to end encryption? Also can I use any relay server to connect, other wise it will lead to centralization (e.g. storing relay server addresses in dht) |
Great blog post, thank you Philipp. Glad to see Phase 3 being WebRTC, as this means self signed certificates for secure connections (something websocket's can't do, so domain-less nodes are stuck at As far as that complexity, you may want to check out str0m if you haven't already. This was being looked at for libp2p but hasn't been implemented yet. Overall I'm glad to see this route being examined. One of the reasons holding me back from using iroh was lack of browser and webrtc support. So yeah, LFG! |
The traffic that's relayed is already encrypted end-to-end, because we're using QUIC :) (Yes, we're compiling a whole QUIC network stack to Wasm and run it in the browser 🙃 ).
Yes, relay servers are identified by URL. As a node, you can decide to use any "home" relay server you want. |
For anyone who's following this issue: We've got preliminary iroh support for browsers via WebAssembly. To try it out, add this git dependency to your iroh = { git = "https://github.com/n0-computer/iroh.git", branch = "matheus23/iroh-browser", default-features = false } Running Some caveats:
Remember, this is specifically support for iroh in browsers, which we expect to be the biggest use case for compiling iroh to WebAssembly. We don't support other related things such as compiling to |
Is this just for the current alpha release or it won't be compatible at all with WASM in the future as well? |
However, You mentioned "with Wasm", though, so, are you referring to using Wasm in environments outside the browser? |
Is this always the case? My questions is because I am interested in solutions where regular servers also participate, and opening a direct websocket connection to a server from a browser client is very possible. But the other way is not as easy. By regular server, I mean applications running on a PC (windows, linux, mac) |
Yes. In the current iroh browser alpha, iroh will always maintain a websocket connection to its home relay. Keep in mind though: iroh in the browser can totally talk to iroh running as a regular native application! They are 100% compatible. |
Thank you for that answer! I hope that when it leaves alpha, it will be able to establish websockets connections directly between clients if possible! I have this idea where I would like browserbased clients to scuttlebut information to PC nodes that are locked inside internet less networks that the clients can join/leave. But I guess I would be limited by local-discovery not being available before direct websocket connections becomes an issue anyway |
Thanks, I did mean just browsers as you mentioned the browser version uses WASM. Would be cool to see outside browsers too though. |
is there any documentation on relays? Is there a way for WSS or WebTransport connections to do direct p2p? sad that webrtc isn't perfect w3c/webrtc-pc#2553 w3c/webrtc-pc#317 (comment) w3c/webrtc-pc#230 arewedistributedyet/arewedistributedyet#7 |
Yeah: https://www.iroh.computer/docs/concepts/relay
Yes and no. In theory you can establish connections from a browser to another endpoint with a public IP address (and might in some network conditions even successfully hole-punch through stateful firewalls and NATs), but you can not connect two browser endpoints to each other directly. That said, |
With regards to local network detection in the browser, I have rolled my own P2P communication thing for a project I've been working on (https://litehouse.arlyon.dev) on top of webrtc and currently use a custom signaling server that lets you discover foreign nodes that share your IP address as resolved by the signaling node. It is used to simplify linking your home to your account for the first time. I realise that custom signaling servers are off the table for iroh but would it be feasible for iroh to offer a similar discovery system to complement mdns? |
iroh allows you to customize discovery with whatever logic you want - including in browsers. With this you might be able to discover other |
We're working on Wasm support so you can use iroh-net in rust applications in browsers. See also the accompanying blogpost.
Here's some prior issues with requests for this:
This is a non-exhaustive list of things that need to land for Wasm support:
socket2
andstd::net::UdpSocket
dependencies inwasm32-unknown-unknown
target quinn-rs/quinn#2037tokio::spawn
and friends #2979 (not strictly necessary in full, but some indirection fortokio::spawn
is necessary)The text was updated successfully, but these errors were encountered: