• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

docs/H13-Feb-2021-311141

examples/H13-Feb-2021-14497

src/H13-Feb-2021-2,2921,808

tests/H13-Feb-2021-2,3011,669

LICENSEH A D13-Feb-20211.5 KiB2622

MANIFEST.inH A D13-Feb-2021126 54

PKG-INFOH A D13-Feb-20214.3 KiB11181

README.rstH A D13-Feb-20212.8 KiB9061

setup.cfgH A D13-Feb-2021433 2721

setup.pyH A D13-Feb-20211.3 KiB4438

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