An implementation of Interactive Connectivity Establishment (RFC 5245)
Project description
What is aioice?
aioice is a library for Interactive Connectivity Establishment (RFC 5245) in Python. It is built on top of `asyncio`, Python’s standard asynchronous I/O framework.
#!/usr/bin/env python
import asyncio
import aioice
async def connect_using_ice(uri):
connection = aioice.Connect(ice_controlling=True)
# gather local candidates
local_candidates = await connection.get_local_candidates()
# send your information to the remote party using your signaling method
send_local_info(
local_candidates,
connection.local_username,
connection.local_password)
# receive remote information using your signaling method
remote_candidates, remote_username, remote_password = get_remote_info()
# perform ICE handshake
connection.remote_username = remote_username
connection.remote_password = remote_password
connection.set_remote_candidates(remote_candidates)
await connection.connect()
# send and receive data
await connection.send(b'1234')
data = await connection.recv(b'1234')
# close connection
await connection.close()
asyncio.get_event_loop().run_until_complete(connect_using_ice())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aioice-0.1.4.tar.gz
(7.2 kB
view hashes)
Built Distribution
aioice-0.1.4-py3-none-any.whl
(9.6 kB
view hashes)