Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
docs/ | H | 13-Feb-2021 | - | 311 | 141 | |
examples/ | H | 13-Feb-2021 | - | 144 | 97 | |
src/ | H | 13-Feb-2021 | - | 2,292 | 1,808 | |
tests/ | H | 13-Feb-2021 | - | 2,301 | 1,669 | |
LICENSE | H A D | 13-Feb-2021 | 1.5 KiB | 26 | 22 | |
MANIFEST.in | H A D | 13-Feb-2021 | 126 | 5 | 4 | |
PKG-INFO | H A D | 13-Feb-2021 | 4.3 KiB | 111 | 81 | |
README.rst | H A D | 13-Feb-2021 | 2.8 KiB | 90 | 61 | |
setup.cfg | H A D | 13-Feb-2021 | 433 | 27 | 21 | |
setup.py | H A D | 13-Feb-2021 | 1.3 KiB | 44 | 38 |
README.rst
1aioice 2====== 3 4|rtd| |pypi-v| |pypi-pyversions| |pypi-l| |pypi-wheel| |tests| |codecov| 5 6.. |rtd| image:: https://readthedocs.org/projects/aioice/badge/?version=latest 7 :target: https://aioice.readthedocs.io/ 8 9.. |pypi-v| image:: https://img.shields.io/pypi/v/aioice.svg 10 :target: https://pypi.python.org/pypi/aioice 11 12.. |pypi-pyversions| image:: https://img.shields.io/pypi/pyversions/aioice.svg 13 :target: https://pypi.python.org/pypi/aioice 14 15.. |pypi-l| image:: https://img.shields.io/pypi/l/aioice.svg 16 :target: https://pypi.python.org/pypi/aioice 17 18.. |pypi-wheel| image:: https://img.shields.io/pypi/wheel/aioice.svg 19 :target: https://pypi.python.org/pypi/aioice 20 21.. |tests| image:: https://github.com/aiortc/aioice/workflows/tests/badge.svg 22 :target: https://github.com/aiortc/aioice/actions 23 24.. |codecov| image:: https://img.shields.io/codecov/c/github/aiortc/aioice.svg 25 :target: https://codecov.io/gh/aiortc/aioice 26 27What is ``aioice``? 28------------------- 29 30``aioice`` is a library for Interactive Connectivity Establishment (RFC 5245) 31in Python. It is built on top of ``asyncio``, Python's standard asynchronous 32I/O framework. 33 34Interactive Connectivity Establishment (ICE) is useful for applications that 35establish peer-to-peer UDP data streams, as it facilitates NAT traversal. 36Typical usecases include SIP and WebRTC. 37 38To learn more about ``aioice`` please `read the documentation`_. 39 40.. _read the documentation: https://aioice.readthedocs.io/en/stable/ 41 42Example 43------- 44 45.. code:: python 46 47 #!/usr/bin/env python 48 49 import asyncio 50 import aioice 51 52 async def connect_using_ice(): 53 connection = aioice.Connection(ice_controlling=True) 54 55 # gather local candidates 56 await connection.gather_candidates() 57 58 # send your information to the remote party using your signaling method 59 send_local_info( 60 connection.local_candidates, 61 connection.local_username, 62 connection.local_password) 63 64 # receive remote information using your signaling method 65 remote_candidates, remote_username, remote_password = get_remote_info() 66 67 # perform ICE handshake 68 for candidate in remote_candidates: 69 await connection.add_remote_candidate(candidate) 70 await connection.add_remote_candidate(None) 71 connection.remote_username = remote_username 72 connection.remote_password = remote_password 73 await connection.connect() 74 75 # send and receive data 76 await connection.sendto(b'1234', 1) 77 data, component = await connection.recvfrom() 78 79 # close connection 80 await connection.close() 81 82 asyncio.get_event_loop().run_until_complete(connect_using_ice()) 83 84License 85------- 86 87``aioice`` is released under the `BSD license`_. 88 89.. _BSD license: https://aioice.readthedocs.io/en/stable/license.html 90