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.5.0.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.5.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for aiostun-0.5.0.tar.gz
Algorithm Hash digest
SHA256 921614e7903152eaf7db83ac9ea074c483fa1f6ef73abab0b43f2627b8d04037
MD5 089ab91ebb6a0daed18f322e330fa255
BLAKE2b-256 2b1cc3a194021cad61ee90dd05085595971f0a1338c5cba7ebb834e1da3fda70

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiostun-0.5.0.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.5.0-py3-none-any.whl.

File metadata

  • Download URL: aiostun-0.5.0-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.12.8

File hashes

Hashes for aiostun-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6ac3f74086465bc3c33a7eeb2c3bbb94ae859846cf2ea97d823b45a94491d4b
MD5 2aab4e50d66fb2e2d70402729a188c65
BLAKE2b-256 544a3e5e2fd357ade46fcf4bd801310ce0e1b353848a733d04cae214f4425935

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiostun-0.5.0-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