iptt


Nameiptt JSON
Version 1.0.5 PyPI version JSON
download
home_pagehttps://gitlab.com/galacteek/iptt/iptt
SummaryInterPlanetary Tunnel Toolkit
upload_time2023-11-19 18:36:02
maintainer
docs_urlNone
authorcipres
requires_python
licenseDEV-NULL
keywords ipfs http
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            InterPlanetary Tunnel Toolkit
=============================

.. image:: https://gitlab.com/galacteek/iptt/iptt/-/raw/master/media/img/iptt-256.png
    :width: 128
    :height: 128

Provides tools to communicate with existing network protocols over
IPFS tunnels (libp2p streams).

- *iphttp*: Command-line iphttp client (supports SSL)
- *iphttpd*: iphttp server (can serve *aiohttp* apps or just forward to an
  existing HTTP service)

.. code-block:: bash

    pip install -U iptt

Checkout the documentation `here <https://iptt.readthedocs.io/en/latest>`_.

iphttp
======

*iphttp* is the command-line client. To make a simple GET request,
pass the PeerId with the HTTP path. Use *--ssl* (or *-s*) to use
SSL encryption:

.. code-block:: bash

    iphttp QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/doc.txt

    iphttp -s QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/doc.txt

Use *--maddr* to pass the RPC API multiaddr_ of your kubo_ node (the
default multiaddr is */ip4/127.0.0.1/tcp/5001*) :

.. code-block:: bash

    iphttp --maddr /dns4/localhost/tcp/5010 \
        QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/summary.html

Interactive mode: just pass a PeerId and all requests in the CLI
session will be based on that peer.

.. code-block:: bash

    iphttp -i QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc

The following commands are supported in interactive mode:

- get(path: str, q={}, h={}): HTTP GET request on path *path* with query *q*
  and HTTP headers *h* (dict)

- post(path: str, q={}, data={}, h={}): HTTP POST request on path with post data *data*, HTTP query *q* (dict) and HTTP headers *h* (dict)

.. code-block:: python

    get('/')
    get('/', q={'arg1': 4})
    get('/', h={'X-Important-Header': 'some-value'})

    post('/form', q={'arg1': 2}, data={'message': 'Form field data'})
    post('/form', data={'message': 'Form field data'})

iphttpd
=======

*iphttpd* allows you to register an IPFS P2P service for an
already running HTTP server, and can also serve an HTTP application
from a Python module (only *aiohttp* apps are supported right now).

Example 1
---------

Serve **http://localhost:7000** for the P2P protocol **/x/ipfs-http/80/1.0**

.. code-block:: bash

    iphttpd -l localhost:80:7080

Example 2
---------

Serve **http://localhost:8080** for the P2P protocol **/x/ipfs-http/8000/1.0**

.. code-block:: bash

    iphttpd -l localhost:8000:8080

Example 3
---------

Serve an aiohttp application from Python module
**iphttpd_apps.helloworld**:

.. code-block:: bash

    iphttpd --serve-aiohttp iphttpd_apps.helloworld

Your module should implement the coroutine **create_app(args)** and return
an *aiohttp.web.Application* instance that will be used to run the service
(see the helloworld_ service).

Example 4
---------

Serve an application with SSL on port 8200:

.. code-block:: bash

    iphttpd -s --serve-aiohttp iphttpd_apps.helloworld --cert iphttpd.io.pem --key iphttpd.io-key.pem -l localhost:443:8200

Projects using iptt
===================

- galacteek_

License
=======

**God bless HTTP, and God bless IPFS** license.

.. _galacteek: https://gitlab.com/galacteek/galacteek
.. _helloworld: https://gitlab.com/galacteek/iptt/iptt/-/blob/master/iphttpd_apps/helloworld.py
.. _kubo: https://github.com/ipfs/kubo
.. _multiaddr: https://multiformats.io/multiaddr

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/galacteek/iptt/iptt",
    "name": "iptt",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "ipfs,http",
    "author": "cipres",
    "author_email": "galacteek@protonmail.com",
    "download_url": "https://files.pythonhosted.org/packages/53/80/c592c4377606b2c2ecc93a905ee894c72d3aa973c50fce862a24e3d1c1eb/iptt-1.0.5.tar.gz",
    "platform": null,
    "description": "InterPlanetary Tunnel Toolkit\n=============================\n\n.. image:: https://gitlab.com/galacteek/iptt/iptt/-/raw/master/media/img/iptt-256.png\n    :width: 128\n    :height: 128\n\nProvides tools to communicate with existing network protocols over\nIPFS tunnels (libp2p streams).\n\n- *iphttp*: Command-line iphttp client (supports SSL)\n- *iphttpd*: iphttp server (can serve *aiohttp* apps or just forward to an\n  existing HTTP service)\n\n.. code-block:: bash\n\n    pip install -U iptt\n\nCheckout the documentation `here <https://iptt.readthedocs.io/en/latest>`_.\n\niphttp\n======\n\n*iphttp* is the command-line client. To make a simple GET request,\npass the PeerId with the HTTP path. Use *--ssl* (or *-s*) to use\nSSL encryption:\n\n.. code-block:: bash\n\n    iphttp QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/doc.txt\n\n    iphttp -s QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/doc.txt\n\nUse *--maddr* to pass the RPC API multiaddr_ of your kubo_ node (the\ndefault multiaddr is */ip4/127.0.0.1/tcp/5001*) :\n\n.. code-block:: bash\n\n    iphttp --maddr /dns4/localhost/tcp/5010 \\\n        QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/summary.html\n\nInteractive mode: just pass a PeerId and all requests in the CLI\nsession will be based on that peer.\n\n.. code-block:: bash\n\n    iphttp -i QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc\n\nThe following commands are supported in interactive mode:\n\n- get(path: str, q={}, h={}): HTTP GET request on path *path* with query *q*\n  and HTTP headers *h* (dict)\n\n- post(path: str, q={}, data={}, h={}): HTTP POST request on path with post data *data*, HTTP query *q* (dict) and HTTP headers *h* (dict)\n\n.. code-block:: python\n\n    get('/')\n    get('/', q={'arg1': 4})\n    get('/', h={'X-Important-Header': 'some-value'})\n\n    post('/form', q={'arg1': 2}, data={'message': 'Form field data'})\n    post('/form', data={'message': 'Form field data'})\n\niphttpd\n=======\n\n*iphttpd* allows you to register an IPFS P2P service for an\nalready running HTTP server, and can also serve an HTTP application\nfrom a Python module (only *aiohttp* apps are supported right now).\n\nExample 1\n---------\n\nServe **http://localhost:7000** for the P2P protocol **/x/ipfs-http/80/1.0**\n\n.. code-block:: bash\n\n    iphttpd -l localhost:80:7080\n\nExample 2\n---------\n\nServe **http://localhost:8080** for the P2P protocol **/x/ipfs-http/8000/1.0**\n\n.. code-block:: bash\n\n    iphttpd -l localhost:8000:8080\n\nExample 3\n---------\n\nServe an aiohttp application from Python module\n**iphttpd_apps.helloworld**:\n\n.. code-block:: bash\n\n    iphttpd --serve-aiohttp iphttpd_apps.helloworld\n\nYour module should implement the coroutine **create_app(args)** and return\nan *aiohttp.web.Application* instance that will be used to run the service\n(see the helloworld_ service).\n\nExample 4\n---------\n\nServe an application with SSL on port 8200:\n\n.. code-block:: bash\n\n    iphttpd -s --serve-aiohttp iphttpd_apps.helloworld --cert iphttpd.io.pem --key iphttpd.io-key.pem -l localhost:443:8200\n\nProjects using iptt\n===================\n\n- galacteek_\n\nLicense\n=======\n\n**God bless HTTP, and God bless IPFS** license.\n\n.. _galacteek: https://gitlab.com/galacteek/galacteek\n.. _helloworld: https://gitlab.com/galacteek/iptt/iptt/-/blob/master/iphttpd_apps/helloworld.py\n.. _kubo: https://github.com/ipfs/kubo\n.. _multiaddr: https://multiformats.io/multiaddr\n",
    "bugtrack_url": null,
    "license": "DEV-NULL",
    "summary": "InterPlanetary Tunnel Toolkit",
    "version": "1.0.5",
    "project_urls": {
        "Homepage": "https://gitlab.com/galacteek/iptt/iptt"
    },
    "split_keywords": [
        "ipfs",
        "http"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3ca0e1b601cca75f5acf15405f011d5532c669b8e252ce4ddba7d7c1235f5064",
                "md5": "7d21cf5ddbce20c8aa9bfe629f495732",
                "sha256": "29b6b053f5c35c891c76843df9c30bef3c320e80f91abb361206b45c6a9803e5"
            },
            "downloads": -1,
            "filename": "iptt-1.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7d21cf5ddbce20c8aa9bfe629f495732",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 10902,
            "upload_time": "2023-11-19T18:36:00",
            "upload_time_iso_8601": "2023-11-19T18:36:00.896381Z",
            "url": "https://files.pythonhosted.org/packages/3c/a0/e1b601cca75f5acf15405f011d5532c669b8e252ce4ddba7d7c1235f5064/iptt-1.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5380c592c4377606b2c2ecc93a905ee894c72d3aa973c50fce862a24e3d1c1eb",
                "md5": "932e1b74730c7865e7d137c6275fd9cc",
                "sha256": "a1473f9f0762a2910fb3b8f0ea329f97b7c8a180d9a1dd862b8df3af598d6b85"
            },
            "downloads": -1,
            "filename": "iptt-1.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "932e1b74730c7865e7d137c6275fd9cc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 9497,
            "upload_time": "2023-11-19T18:36:02",
            "upload_time_iso_8601": "2023-11-19T18:36:02.742206Z",
            "url": "https://files.pythonhosted.org/packages/53/80/c592c4377606b2c2ecc93a905ee894c72d3aa973c50fce862a24e3d1c1eb/iptt-1.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-19 18:36:02",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "galacteek",
    "gitlab_project": "iptt",
    "lcname": "iptt"
}
        
Elapsed time: 0.20232s