- Support RFC3489
- Transports UDP, TCP and TLS
- IPv4 and IPv6 support
- Support RFC5389
- Support RFC5780
- Support RFC8489
This module can be installed from pypi website
pip install aiostun
import aiostun
import asyncio
async def main():
async with aiostun.Client(host='openrelay.metered.ca', port=443, ipproto=aiostun.TLS) as stunc:
mapped_addr = await stunc.get_mapped_address()
print(mapped_addr)
{'family': 'IPv4', 'port': 38778, 'ip': 'xx.xx.xx.xx'}
asyncio.run(main())
Default constants for family:
aiostun.IP4
(default)aiostun.IP6
Default constants for IP protocol:
aiostun.UDP
(default)aiostun.TCP
aiostun.TLS
The default remote port is 3478
with a timeout connection of 2 seconds
.
Running all test units.
python3 -m unittest discover tests/ -v