yapystun


Nameyapystun JSON
Version 0.2.2 PyPI version JSON
download
home_page
SummarySimple STUN Client
upload_time2023-11-28 10:24:24
maintainer
docs_urlNone
authorYour Name
requires_python>=3.8,<4.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: https://travis-ci.org/jtriley/pystun.svg?branch=master
    :target: https://travis-ci.org/jtriley/pystun

.. image:: https://coveralls.io/repos/jtriley/pystun/badge.png
   :target: https://coveralls.io/r/jtriley/pystun


Yet Another PyStun Fork. Works with Python 3.11. Forked from:

```https://github.com/jtriley/pystun```

PyStun
======
A Python STUN client for getting NAT type and external IP

This is a fork of pystun originally created by gaohawk (http://code.google.com/p/pystun/)

PyStun follows RFC 3489: http://www.ietf.org/rfc/rfc3489.txt

A server following STUN-bis hasn't been found on internet so RFC3489 is the
only implementation.

Installation
------------
To install the latest version::

    $ pip install pystun

or download/clone the source and install manually using::

    $ cd /path/to/pystun/src
    $ python setup.py install

If you're hacking on pystun you should use the 'develop' command instead::

    $ python setup.py develop

This will make a link to the sources inside your site-packages directory so
that any changes are immediately available for testing.

Usage
-----
From command line::

    $ pystun
    NAT Type: Full Cone
    External IP: <your-ip-here>
    External Port: 54320

Pass --help for more options::

    % pystun --help
    usage: pystun [-h] [-d] [-H STUN_HOST] [-P STUN_PORT] [-i SOURCE_IP]
                  [-p SOURCE_PORT] [--version]

    optional arguments:
      -h, --help            show this help message and exit
      -d, --debug           Enable debug logging (default: False)
      -H STUN_HOST, --host STUN_HOST
                            STUN host to use (default: None)
      -P STUN_PORT, --host-port STUN_PORT
                            STUN host port to use (default: 3478)
      -i SOURCE_IP, --interface SOURCE_IP
                            network interface for client (default: 0.0.0.0)
      -p SOURCE_PORT, --port SOURCE_PORT
                            port to listen on for client (default: 54320)
      --version             show program's version number and exit

From Python::

    import stun
    nat_type, external_ip, external_port = stun.get_ip_info()

This will rotate through an internal list of STUN servers until a response is
found. If no response is found you will get "Blocked" as the *nat_type* and
**None** for *external_ip* and *external_port*.

If you prefer to use a specific STUN server::

    nat_type, external_ip, external_port = stun.get_ip_info(stun_host='stun.ekiga.net')

If you prefer to use a specific STUN server port::

    nat_type, external_ip, external_port = stun.get_ip_info(stun_port=3478)

You may also specify the client interface and port that is used although this
is not needed::

    sip = "0.0.0.0" # interface to listen on (all)
    port = 54320 # port to listen on
    nat_type, external_ip, external_port = stun.get_ip_info(sip, port)

Read the code for more details...

LICENSE
-------
MIT

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "yapystun",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/6c/09/0d22a1c8a22748c8c875cc3dc04b464bd846f82c0c9a9143227cbb69fe3d/yapystun-0.2.2.tar.gz",
    "platform": null,
    "description": ".. image:: https://travis-ci.org/jtriley/pystun.svg?branch=master\n    :target: https://travis-ci.org/jtriley/pystun\n\n.. image:: https://coveralls.io/repos/jtriley/pystun/badge.png\n   :target: https://coveralls.io/r/jtriley/pystun\n\n\nYet Another PyStun Fork. Works with Python 3.11. Forked from:\n\n```https://github.com/jtriley/pystun```\n\nPyStun\n======\nA Python STUN client for getting NAT type and external IP\n\nThis is a fork of pystun originally created by gaohawk (http://code.google.com/p/pystun/)\n\nPyStun follows RFC 3489: http://www.ietf.org/rfc/rfc3489.txt\n\nA server following STUN-bis hasn't been found on internet so RFC3489 is the\nonly implementation.\n\nInstallation\n------------\nTo install the latest version::\n\n    $ pip install pystun\n\nor download/clone the source and install manually using::\n\n    $ cd /path/to/pystun/src\n    $ python setup.py install\n\nIf you're hacking on pystun you should use the 'develop' command instead::\n\n    $ python setup.py develop\n\nThis will make a link to the sources inside your site-packages directory so\nthat any changes are immediately available for testing.\n\nUsage\n-----\nFrom command line::\n\n    $ pystun\n    NAT Type: Full Cone\n    External IP: <your-ip-here>\n    External Port: 54320\n\nPass --help for more options::\n\n    % pystun --help\n    usage: pystun [-h] [-d] [-H STUN_HOST] [-P STUN_PORT] [-i SOURCE_IP]\n                  [-p SOURCE_PORT] [--version]\n\n    optional arguments:\n      -h, --help            show this help message and exit\n      -d, --debug           Enable debug logging (default: False)\n      -H STUN_HOST, --host STUN_HOST\n                            STUN host to use (default: None)\n      -P STUN_PORT, --host-port STUN_PORT\n                            STUN host port to use (default: 3478)\n      -i SOURCE_IP, --interface SOURCE_IP\n                            network interface for client (default: 0.0.0.0)\n      -p SOURCE_PORT, --port SOURCE_PORT\n                            port to listen on for client (default: 54320)\n      --version             show program's version number and exit\n\nFrom Python::\n\n    import stun\n    nat_type, external_ip, external_port = stun.get_ip_info()\n\nThis will rotate through an internal list of STUN servers until a response is\nfound. If no response is found you will get \"Blocked\" as the *nat_type* and\n**None** for *external_ip* and *external_port*.\n\nIf you prefer to use a specific STUN server::\n\n    nat_type, external_ip, external_port = stun.get_ip_info(stun_host='stun.ekiga.net')\n\nIf you prefer to use a specific STUN server port::\n\n    nat_type, external_ip, external_port = stun.get_ip_info(stun_port=3478)\n\nYou may also specify the client interface and port that is used although this\nis not needed::\n\n    sip = \"0.0.0.0\" # interface to listen on (all)\n    port = 54320 # port to listen on\n    nat_type, external_ip, external_port = stun.get_ip_info(sip, port)\n\nRead the code for more details...\n\nLICENSE\n-------\nMIT\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Simple STUN Client",
    "version": "0.2.2",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "07788b09c9ef117cc940ea3d3a7e93f54103eb022d160d57d2d3ac6cb1e91590",
                "md5": "eeb0cfe7539de76eb1625433f6d192a9",
                "sha256": "49fa8f5ac5f26cfa1da05538adbf3d57d6b67094e677b45c6d2370479e415c0c"
            },
            "downloads": -1,
            "filename": "yapystun-0.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "eeb0cfe7539de76eb1625433f6d192a9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 6465,
            "upload_time": "2023-11-28T10:24:23",
            "upload_time_iso_8601": "2023-11-28T10:24:23.487251Z",
            "url": "https://files.pythonhosted.org/packages/07/78/8b09c9ef117cc940ea3d3a7e93f54103eb022d160d57d2d3ac6cb1e91590/yapystun-0.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6c090d22a1c8a22748c8c875cc3dc04b464bd846f82c0c9a9143227cbb69fe3d",
                "md5": "2c3212cd72d7016effbdcee079d1eefe",
                "sha256": "821c49c22057f85ca9712a69c856777b6176253118054c366694a2e9f9664675"
            },
            "downloads": -1,
            "filename": "yapystun-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "2c3212cd72d7016effbdcee079d1eefe",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 5511,
            "upload_time": "2023-11-28T10:24:24",
            "upload_time_iso_8601": "2023-11-28T10:24:24.614654Z",
            "url": "https://files.pythonhosted.org/packages/6c/09/0d22a1c8a22748c8c875cc3dc04b464bd846f82c0c9a9143227cbb69fe3d/yapystun-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-28 10:24:24",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "yapystun"
}
        
Elapsed time: 0.16537s