# Async STUN client for Python
## Key Features
- [x] Support RFC3489
- [x] Transports UDP, TCP and TLS
- [x] IPv4 and IPv6 support
- [ ] Support RFC5389
- [ ] Support RFC5780
- [ ] Support RFC8489
## Installation
This module can be installed from [pypi](https://pypi.org/project/aiostun/) website
```python
pip install aiostun
```
## Getting your mapped address
```python
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.
```bash
python3 -m unittest discover tests/ -v
```
Raw data
{
"_id": null,
"home_page": "https://github.com/dmachard/python-aiostun",
"name": "aiostun",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "stun client",
"author": "Denis MACHARD",
"author_email": "d.machard@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e4/0d/0bdae0e8e5d3aef14ec376e249d9c094306db87e829db177b475d37a44a0/aiostun-0.3.1.tar.gz",
"platform": "any",
"description": "# Async STUN client for Python\n\n## Key Features\n\n- [x] Support RFC3489\n- [x] Transports UDP, TCP and TLS\n- [x] IPv4 and IPv6 support\n- [ ] Support RFC5389\n- [ ] Support RFC5780\n- [ ] Support RFC8489\n\n## Installation\n\nThis module can be installed from [pypi](https://pypi.org/project/aiostun/) website\n\n```python\npip install aiostun\n```\n\n## Getting your mapped address\n\n```python\nimport aiostun\nimport asyncio\n\nasync def main():\n\n async with aiostun.Client(host='openrelay.metered.ca', port=443, ipproto=aiostun.TLS) as stunc:\n mapped_addr = await stunc.get_mapped_address()\n print(mapped_addr)\n {'family': 'IPv4', 'port': 38778, 'ip': 'xx.xx.xx.xx'}\n\nasyncio.run(main())\n```\n\nDefault constants for family:\n- `aiostun.IP4` (default)\n- `aiostun.IP6`\n\nDefault constants for IP protocol:\n- `aiostun.UDP` (default)\n- `aiostun.TCP`\n- `aiostun.TLS`\n\nThe default remote port is `3478` with a timeout connection of `2 seconds`.\n\n## For developers\n\nRunning all test units.\n\n```bash\npython3 -m unittest discover tests/ -v\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "Asynchronous STUN client for Python with UDP, TCP and TLS support",
"version": "0.3.1",
"project_urls": {
"Homepage": "https://github.com/dmachard/python-aiostun"
},
"split_keywords": [
"stun",
"client"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bacf46eb2d18200777effcc5c944a1a32d85b9596f65ab73cc92f51d6c3986c6",
"md5": "1b40b94375115fe0c34712042d59b3a7",
"sha256": "99f8d2b3b9b2a63df6dd599d531e9b0d0369852cb2c83db87b73cb13db604417"
},
"downloads": -1,
"filename": "aiostun-0.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1b40b94375115fe0c34712042d59b3a7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 11949,
"upload_time": "2023-12-10T08:10:11",
"upload_time_iso_8601": "2023-12-10T08:10:11.615705Z",
"url": "https://files.pythonhosted.org/packages/ba/cf/46eb2d18200777effcc5c944a1a32d85b9596f65ab73cc92f51d6c3986c6/aiostun-0.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e40d0bdae0e8e5d3aef14ec376e249d9c094306db87e829db177b475d37a44a0",
"md5": "3f9766aaf07b0bd56e984ac9c0d1a443",
"sha256": "ab728c854bb7fe7e4a748ff2675fc114c9945901627af5a35965f61d39dd6f1f"
},
"downloads": -1,
"filename": "aiostun-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "3f9766aaf07b0bd56e984ac9c0d1a443",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10586,
"upload_time": "2023-12-10T08:10:12",
"upload_time_iso_8601": "2023-12-10T08:10:12.507461Z",
"url": "https://files.pythonhosted.org/packages/e4/0d/0bdae0e8e5d3aef14ec376e249d9c094306db87e829db177b475d37a44a0/aiostun-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-10 08:10:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dmachard",
"github_project": "python-aiostun",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "aiostun"
}