Async STUN client for Python
Key Features
- Support RFC3489
- Transports UDP, TCP and TLS
- IPv4 and IPv6 support
- Support RFC5389
- Support RFC5780
- Support RFC8489
Installation
This module can be installed from pypi website
pip install aiostun
Getting your mapped address
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.TCPaiostun.TLS
The default remote port is 3478 with a timeout connection of 2 seconds.
For developers
Running all test units.
python3 -m unittest discover tests/ -v
Metadata
Release files for aiostun 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aiostun-0.6.1.tar.gz | 10.9 kB | With provenance | Details for aiostun-0.6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aiostun-0.6.1-py3-none-any.whl | Python 3 | none | any | Details for aiostun-0.6.1-py3-none-any.whl |
Total release size: 23.1 kB
Release files / aiostun-0.6.1.tar.gz
| Download URL | aiostun-0.6.1.tar.gz |
|---|---|
| Size | 10.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9481f588dd5fd5dec870b32f536ae031690af6b4f0b9d0e9c3cbf12e5a81ccf8
|
|
BLAKE2b-256 checksum How to use checksums |
f80120692b33ebee4efd0f036b2dc6e9abb249fc88810cb31eec3cbd304ec045
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 8, 2026.
Transparency logRelease files / aiostun-0.6.1-py3-none-any.whl
| Download URL | aiostun-0.6.1-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23bc5b8dd369a09550e36e546b41919ea06e9f3fc444dfe2784f8cf865f137df
|
|
BLAKE2b-256 checksum How to use checksums |
6a4b5de88828a87da49083fd2298cfd98571a8ca0a32e79d500a0bde279ad286
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 8, 2026.
Transparency logSecurity for aiostun 0.6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for aiostun-0.6.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.