Skip to main content

Asynchronous STUN client for Python with UDP, TCP and TLS support

Project description

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.TCP
  • aiostun.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

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

aiostun-0.6.1.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiostun-0.6.1-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file aiostun-0.6.1.tar.gz.

File metadata

  • Download URL: aiostun-0.6.1.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aiostun-0.6.1.tar.gz
Algorithm Hash digest
SHA256 9481f588dd5fd5dec870b32f536ae031690af6b4f0b9d0e9c3cbf12e5a81ccf8
MD5 77916d4a9bffbe68df27651927b09174
BLAKE2b-256 f80120692b33ebee4efd0f036b2dc6e9abb249fc88810cb31eec3cbd304ec045

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiostun-0.6.1.tar.gz:

Publisher: publish.yml on dmachard/python-aiostun

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aiostun-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: aiostun-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aiostun-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 23bc5b8dd369a09550e36e546b41919ea06e9f3fc444dfe2784f8cf865f137df
MD5 ee9d0a19680ca91e742594e8951267b8
BLAKE2b-256 6a4b5de88828a87da49083fd2298cfd98571a8ca0a32e79d500a0bde279ad286

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiostun-0.6.1-py3-none-any.whl:

Publisher: publish.yml on dmachard/python-aiostun

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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