# python3-pytun
`python3-pytun` is an update to the `pytun` module that enables installation when using Python3. The package name was
updated for pip installation as the original appears to be abandoned. It should be a drop-in replacement (still use `import pytun`.)
The patch was originally written by @famince and is available [here](https://github.com/famince/pytun).
Original `pytun` was written by @gawen and is available [here](https://github.com/gawen/pytun).
Original `README.md` continues below.
## pytun
`pytun` is a Python module to manage tun/tap IP tunnel in the same way you would manipulate a file handler.
For now, it is only compatible with Linux, probably Unix, maybe MacOsX, and in the future Windows.
`pytun` is under the MIT license.
### How to use
First of all, clone this repos or use `easy_install` or `pip`.
pip install pytun
easy_install pytun
Quite easy. Use the `open()` function.
import pytun
tun = pytun.open() # Open a TUN mode tunnel
For a TAP tunnel, add the `"tap"` argument.
tun = pytun.open("tap")
`tun` is the handler for the newly created tunnel and is manipulated like a file.
To read/write, use the standard methods `recv([size = 1500])` and `send(buf)`
buf = tun.recv()
tun.send(buf)
tun is also `select()` compatible to make your network reactor asynchronous.
import select
fds = select.select([tun, ...], [...], [...])
Finally, you can close the tunnel using the method `close()`.
tun.close()
The tunnel automatically closes when the object is not referenced anymore and the garbage collector destroys the handler.
Raw data
{
"_id": null,
"home_page": "https://github.com/ebob9/pytun",
"name": "python3-pytun",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6.1",
"maintainer_email": "",
"keywords": "",
"author": "Aaron Edwards",
"author_email": "pytun@ebob9.com",
"download_url": "https://files.pythonhosted.org/packages/fe/8a/a5fcf11c53a44ad4ed2344048d92e5c25b77bd6cd04d71283c941c1f6692/python3-pytun-1.0.2.2.tar.gz",
"platform": null,
"description": "# python3-pytun\n\n`python3-pytun` is an update to the `pytun` module that enables installation when using Python3. The package name was \nupdated for pip installation as the original appears to be abandoned. It should be a drop-in replacement (still use `import pytun`.)\n\nThe patch was originally written by @famince and is available [here](https://github.com/famince/pytun).\n\nOriginal `pytun` was written by @gawen and is available [here](https://github.com/gawen/pytun).\n\nOriginal `README.md` continues below.\n\n## pytun\n`pytun` is a Python module to manage tun/tap IP tunnel in the same way you would manipulate a file handler.\n\nFor now, it is only compatible with Linux, probably Unix, maybe MacOsX, and in the future Windows.\n\n`pytun` is under the MIT license.\n\n### How to use\n\nFirst of all, clone this repos or use `easy_install` or `pip`.\n\n pip install pytun\n easy_install pytun\n\nQuite easy. Use the `open()` function.\n\n import pytun\n\n tun = pytun.open() # Open a TUN mode tunnel\n\nFor a TAP tunnel, add the `\"tap\"` argument.\n\n tun = pytun.open(\"tap\")\n\n`tun` is the handler for the newly created tunnel and is manipulated like a file.\n\nTo read/write, use the standard methods `recv([size = 1500])` and `send(buf)`\n\n buf = tun.recv()\n tun.send(buf)\n\ntun is also `select()` compatible to make your network reactor asynchronous.\n\n import select\n\n fds = select.select([tun, ...], [...], [...])\n\nFinally, you can close the tunnel using the method `close()`.\n\n tun.close()\n\nThe tunnel automatically closes when the object is not referenced anymore and the garbage collector destroys the handler.\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python TUN/TAP tunnel module, Python3 compatible",
"version": "1.0.2.2",
"project_urls": {
"Homepage": "https://github.com/ebob9/pytun"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fe8aa5fcf11c53a44ad4ed2344048d92e5c25b77bd6cd04d71283c941c1f6692",
"md5": "8eb4db1d94741e2ff972bf47f80dab29",
"sha256": "25c8906296299bd1fd16c7b432f906410c896b0ae7ef321456aa73f52e0dbae5"
},
"downloads": -1,
"filename": "python3-pytun-1.0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "8eb4db1d94741e2ff972bf47f80dab29",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6.1",
"size": 5525,
"upload_time": "2023-10-28T01:39:20",
"upload_time_iso_8601": "2023-10-28T01:39:20.254113Z",
"url": "https://files.pythonhosted.org/packages/fe/8a/a5fcf11c53a44ad4ed2344048d92e5c25b77bd6cd04d71283c941c1f6692/python3-pytun-1.0.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-28 01:39:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ebob9",
"github_project": "pytun",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "python3-pytun"
}