Skip to main content

An implementation of Interactive Connectivity Establishment (RFC 5245)

Project description

rtd pypi-v pypi-pyversions pypi-l pypi-wheel tests codecov

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.

Interactive Connectivity Establishment (ICE) is useful for applications that establish peer-to-peer UDP data streams, as it facilitates NAT traversal. Typical usecases include SIP and WebRTC.

To learn more about aioice please read the documentation.

Example

#!/usr/bin/env python

import asyncio
import aioice

async def connect_using_ice():
    connection = aioice.Connection(ice_controlling=True)

    # gather local candidates
    await connection.gather_candidates()

    # send your information to the remote party using your signaling method
    send_local_info(
        connection.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
    for candidate in remote_candidates:
        await connection.add_remote_candidate(candidate)
    await connection.add_remote_candidate(None)
    connection.remote_username = remote_username
    connection.remote_password = remote_password
    await connection.connect()

    # send and receive data
    await connection.sendto(b'1234', 1)
    data, component = await connection.recvfrom()

    # close connection
    await connection.close()

asyncio.get_event_loop().run_until_complete(connect_using_ice())

License

aioice is released under the BSD license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aioice2-0.9.0.post1.tar.gz (40.1 kB view details)

Uploaded Source

Built Distribution

aioice2-0.9.0.post1-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file aioice2-0.9.0.post1.tar.gz.

File metadata

  • Download URL: aioice2-0.9.0.post1.tar.gz
  • Upload date:
  • Size: 40.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for aioice2-0.9.0.post1.tar.gz
Algorithm Hash digest
SHA256 f40704b1ad50642ad8f6b743ffe53f389336fa6beaa07a6afdebb070dae2669d
MD5 b57692982a17b3cc985f950e0c8c5176
BLAKE2b-256 39fdc65cc1fb0edfe61feae6474da3d3a4a34f930b005c595089f49a671d720c

See more details on using hashes here.

File details

Details for the file aioice2-0.9.0.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for aioice2-0.9.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 4545b989b4aadc6fe320794503a87b6b5cd798685b38b2d53c1253ca5d86df52
MD5 ef3a6b6f9dcca23094389c01b16e67e3
BLAKE2b-256 2027296fd21219c4908878c12609023a3865bf1f1775082ed554dd833693b864

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page