webrtc-rs / ice Goto Github PK
View Code? Open in Web Editor NEWA pure Rust implementation of ICE
Home Page: https://webrtc.rs
License: Apache License 2.0
A pure Rust implementation of ICE
Home Page: https://webrtc.rs
License: Apache License 2.0
In order to test NAT, VNet is required for ICE.
Just FYI, there is https://github.com/ystreet/librice library, which also aims to implement ICE in Rust, maybe there is a potential for collaboration here.
I've made some changes to the UDPMuxDefault
(link) and had to copy UDPMuxConn
, UDPMuxConnParams
and socket_addr_ext.rs as well.
Would you agree to expose UDPMuxConn
and UDPMuxConnParams
so that people can tweak UDPMuxDefault
(read create alternative UDP muxes) ? Thanks ๐
I'd like to use this crate to establish a peer-to-peer connection between clients, but after that I'd like to obtain the underlying (udp) connection.
Without async closure support in those callbacks, it may cause many use-cases unfriendly.
pub type OnConnectionStateChangeHdlrFn = Box<dyn FnMut(ConnectionState) + Send + Sync>;
pub type OnSelectedCandidatePairChangeHdlrFn =
Box<dyn FnMut(&(dyn Candidate + Send + Sync), &(dyn Candidate + Send + Sync)) + Send + Sync>;
pub type OnCandidateHdlrFn = Box<dyn FnMut(Option<Arc<dyn Candidate + Send + Sync>>) + Send + Sync>;
Hey! I'm just browsing the ping_pong example here, and noticed something strange: The request to /remoteCandidate has a content-type
of application/json
but the data being sent is not JSON. I'm not sure what format it is meant to be or else I'd be doing a PR instead, but regardless this seems wrong as the format is not JSON-based.
I believe that the ICE agent is performing connectivity checks even though I've set the lite flag to true in the AgentConfig used to create it. If I understand it correctly, ice-lite agents don't generate connectivity checks: https://datatracker.ietf.org/doc/html/rfc8445#section-2.5
Having a lite agent not generate connectivity checks is useful when using unsignalled WebRTC connections, because then one agent doesn't need to know the ICE password (or potentially even the username) of the peer that is connecting to it.
I tried to make a minimal example: https://github.com/evan-brass/webrtc-rs-ice-bug/blob/master/src/main.rs
Which gave me a network trace like this:
The second Binding request is from Peer1 (the lite-client) to Peer2 (the full client).
I'm still not-very familiar with the webrtc-ice library's code, but I believe that perhaps a check is needed within the ControlledSelector implementation for AgentInternal?:
ice/src/agent/agent_selector.rs
Line 539 in 8a41f85
ice/src/agent/agent_selector.rs
Line 535 in 8a41f85
I'm still new to ICE and the protocol level of WebRTC so if I'm misunderstanding the protocol, just let me know.
Thank you,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.