-
Notifications
You must be signed in to change notification settings - Fork 50
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
Using str0m
in rust-libp2p
#166
Comments
@thomaseizinger direct api is probably the way to go here instead of fighting sdp. regarding What is the corresponding setting in webrtc-rs? |
Cool, thanks for the confirmation!
|
This is how we use it: https://github.com/libp2p/rust-libp2p/blob/a00daca5fa39e68437c91335f46dcd4c685dee18/transports/webrtc/src/tokio/upgrade.rs#L132-L156 |
if you just bypass it in your fork, can you get it to work? essentially just make this section noop |
I'll try but I am not seeing any errors regarding dTLS failures at the moment. I've pasted my latest logs here: #164 (comment) For some reason, the candidates I am adding fail. Any idea why? |
Not sure based on that log. Here is a branch, were I disabled the certificate verification. |
// We keep propagating client events until all clients respond with a timeout. You would need this to send responses to your client. |
it probably easier use the http example just to get connection + datachannel going rather than using the chat example. |
Good hint, thank you! :) |
I didn't realize that was a separate example! I just found https://github.com/algesten/str0m/blob/main/tests/data-channel-direct.rs which gave me some ideas on what I want to test. |
@thomaseizinger sorry if I'm being dense. Was there a link to a repro so I could play around? |
It is a branch on my fork: https://github.com/thomaseizinger/str0m/tree/libp2p-webrtc-playground |
git clone https://github.com/thomaseizinger/str0m str0m_p2p cd str0m_p2p git checkout libp2p-webrtc-playground cargo run --example chat look for: use in bootnode multiaddr in |
Thanks! Sorry for not giving more detailed instructions. Does it even makes sense to test this on a single machine or do I need two? The connection seems to fail with:
I don't really know what to look for next. It seems like the connection is not established? |
Should be able to connect fine on the same machine. I would:
focus on the things that are "funky" like the ice credentials and how the candidate looks like. |
You need to call |
@thomaseizinger can this one be closed now, or are there more things outstanding? |
In #324, @altonen mentioned that they managed to implement it which would be amazing! I'll defer to them here! :) I am excited to see the code! |
I think this can be closed, |
Following the advice from here, I am opening a separate issue!
Here is what we want to do: Have libp2p applications running in the browser connect to server nodes that don't have a valid TLS certificate. Being in the browser, we don't have control over the WebRTC stack but use the
RTCPeerConnection
API.The entire protocol is described here: https://github.com/libp2p/specs/blob/master/webrtc/webrtc-direct.md#browser-to-public-server
We also don't have separate STUN servers. Instead, the client knows the server's address through an out-of-band mechanism. We have a self-descriptive address format that looks like this:
The component after the
/certhash
part (uEiD8c9GWyEurSjh9UkY-YWXaXBJZIHo179zx9IpgDFFKgw
) is the server's certificate fingerprint. This gives us enough information to directly connect to the server.We want to use
str0m
for the server part of this setup. The node will always be publicly reachable, hence we are in ICE-lite mode. We only ever need data channels, no media.Concrete questions I have:
sdp_api
. I think I achieved the same thing with thedirect_api
and adding candidates myself. Is there something I should be aware of when doing it that way?More general questions:
str0m
?The text was updated successfully, but these errors were encountered: