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.4.1.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

aiostun-0.4.1-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiostun-0.4.1.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for aiostun-0.4.1.tar.gz
Algorithm Hash digest
SHA256 aa352d27d43a3f090fb3d344d0611ee7a15d4e375d5b095b97883897e611e5e1
MD5 8104347788c77dfa19ff27fc2c8e9d47
BLAKE2b-256 792730edf9575778ced5717628795433c6d228f53485825485b20e510b5f4dad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aiostun-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for aiostun-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 598aa5f9fec2c9ab51884ed1023d471432ff3c14338bc78a25d39e59e7c39f2e
MD5 cff33f9a163923466ed949daa11a2edc
BLAKE2b-256 676c73c0ae67eef9dc3493f506c92c59a7d3ee43685099f2dbd53f5b29e0fe2f

See more details on using hashes here.

Supported by

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