Python implementation of WebRTC and ORTC for real-time peer-to-peer communication
87
Build a connection negotiator that establishes a WebRTC connection between two peers through proper SDP offer/answer exchange. The negotiator should handle the complete signaling flow from offer creation through answer acceptance.
Your implementation should:
Create a Python module with an async function negotiate_connection() that:
Input: Execute the negotiation function
Expected Output:
Test File: test_negotiation.py
import pytest
from negotiation import negotiate_connection
@pytest.mark.asyncio
async def test_successful_negotiation():
offering_state, answering_state = await negotiate_connection()
assert offering_state == "stable"
assert answering_state == "stable"Input: Execute the negotiation function
Expected Output:
Test File: test_negotiation.py
import pytest
from negotiation import negotiate_connection
@pytest.mark.asyncio
async def test_no_errors():
try:
await negotiate_connection()
success = True
except Exception:
success = False
assert success is TrueProvides WebRTC implementation for Python including peer connection management and SDP negotiation.
Install with Tessl CLI
npx tessl i tessl/pypi-aiortcdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10