-
Notifications
You must be signed in to change notification settings - Fork 173
Feat/add webrtc transport #780
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: main
Are you sure you want to change the base?
Conversation
Hey @Nkovaturient, after our discussion, I have made some changes to the SDP and ICE exchange protocols for it to be interoperable with JS.
Also, in the meantime, can you check for |
Sure, gonna fix them. |
969868f
to
13378e6
Compare
@Nkovaturient , @sukhman-sukh : Great work :) Added some feedback on the tests proposed at #839 . Wonderful progress indeed. Reviewing the PR and looking forward to successful completion of the WebRTC direct PR in the coming days. CCing @pacrob, @Winter-Soren, @AkMo3, @acul71, @guha-rahul and @lla-dane for their feedback and pointers. Looking forward to seeing WebRTC direct in production soon :) |
1cd4b3f
to
13378e6
Compare
Hey @seetadev,
Add stream is the second last and Fix lint is the last commit |
Also, I am facing difficulty in some functions of listener which for now I have created as a placeholder as JS has something called |
Description
Issue #546
Updates
✅ Core Transport Implementation
✅ js-libp2p Compatibility
/libp2p/webrtc/signal/1.0.0
message format complianceuEi
prefixed base64url certificate hashes✅ Production-Ready Features
Technical Architecture & Design Decisions
Why trio-asyncio Instead of Pure Trio?
Core Challenge: py-libp2p uses Trio for async operations, but aiortc (the robust Python WebRTC library) is built entirely on asyncio. This created a fundamental integration challenge that required careful architectural decisions.
Solution: I have implemented a sophisticated trio-asyncio bridge (
WebRTCAsyncBridge
) that provides:Alternative Considered: Writing a pure trio WebRTC implementation would eliminate bridge complexity but would require reimplementing significant portions of WebRTC protocols (DTLS, SCTP, ICE) - a massive undertaking that would delay delivery and introduce bugs.
The trio-asyncio Bridge: Why Essential?
Bridge Benefits:
Current Status
Main Test Suite (
test_webrtc_transport.py
)Specialized Test Suites
test_js_libp2p_interop.py
: Dedicated js-libp2p compatibility validationtest_live_signaling.py
: Live signaling with circuit relay simulationtest_network_optimized.py
: Network-independent testing for CI/CD environmentsQuestions
Performance Impact: How does the trio-asyncio bridge affect performance in high-throughput scenarios with 100+ concurrent WebRTC connections? Should we prioritize a pure trio WebRTC implementation for v2?
Stream Multiplexing Integration: How should WebRTC streams integrate with existing yamux/mplex stream multiplexing? Should WebRTC connections be treated as muxed connections themselves, or as transport-level primitives?
Circuit Relay Strategy: What's the preferred integration path for circuit relay reservations with the existing relay discovery mechanism? Should WebRTC transport handle relay discovery independently or leverage existing infrastructure?
NAT Traversal Prioritization: When both STUN servers and direct UDP hole punching are available, what's the preferred fallback hierarchy? How do we balance connection speed vs reliability?
Resource Management Philosophy: Given the trio-asyncio bridge complexity, should we add connection pooling and resource limits to prevent memory leaks in long-running applications?
Next work
IHost
for utilising real network resources for addressing webrtc listeners and get_network [currently on timeout and mocks ]private-to-private
transport.py. [Must be modular for its extension and utilisation in webrtc-direct transport as well]Cute Animal Picture