http-tunnel


Namehttp-tunnel JSON
Version 0.6.9 PyPI version JSON
download
home_pagehttps://github.com/yxc890123/http-tunnel
SummaryHTTP tunneling tool.
upload_time2024-07-19 00:27:34
maintainerNone
docs_urlNone
authoryxc890123
requires_python>=3.8
licenseApache 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # http-tunnel

Tunneling all sockets by using regular HTTP requests.

## Why

If you always suffered from the limitations of proxy or firewall that cannot be avoided,
then this tool MIGHT be useful for you.

## How it works

It is a pair of HTTP client/server programs.
The client also acts as a server, capturing all incoming sockets and sending them to the server.
The server then sends the received socket data to the target server.

All data between the client and server is encrypted and wrapped in HTTP requests.

HTTPS is supported, but your proxy may block self-signed server certificates.
Even with a formal certificate, the proxy may still decrypt the SSL/TLS layer by using fake certificates,
and the data is encrypted (again, by this tool) anyway.

HTTPS may be only necessary for WebSocket since it will connect by using the CONNECT method via proxy,
which is probably not allowed other than HTTPS.

If there is still any concern, put the server behind a firewall or any reverse proxy that can handle SSL/TLS connections.

## Problems

The connection WILL be slow, and may not be stable too.

Although the WebSocket method can do way better performance than others, it may not be suitable for all situations.

Since HTTP is stateless,
it's better to use this tool with other "real" tunnel protocols, such as SSH, that maintain consistent connections,
otherwise, it may consume a lot of sessions, which is not efficient and might be suspected.

## Requirements

- Python 3.8+
  - [requests](https://pypi.org/project/requests/), [pysocks](https://pypi.org/project/PySocks/) (for easy client handling)
  - [fastapi-slim](https://pypi.org/project/fastapi-slim/), [uvicorn](https://pypi.org/project/uvicorn/) (for easy server implementation)
  - [websockets](https://pypi.org/project/websockets/) (for WebSocket implementation)
  - [cryptography](https://pypi.org/project/cryptography/)
- OS: Linux, Windows, MacOS(not tested)

## Installation

```bash
pip install http-tunnel
```

## Usage

- To start server:

  ```bash
  http-tunnel -s
  ```

- To start client:

  ```bash
  http-tunnel -c
  ```

  **Note:** To use proxy, set the `HTTP_PROXY` or `HTTPS_PROXY` environment variable.

- For more information:

  ```bash
  http-tunnel --help
  ```

## Still working on

1. ~~Support other request methods.~~
   - [x] ~~POST~~
   - [x] ~~PUT~~
   - [x] ~~DELETE~~
   - [x] ~~PATCH~~
   - [x] ~~WebSocket~~
2. Support UDP.

## As always

Use at your own risk and responsibility.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yxc890123/http-tunnel",
    "name": "http-tunnel",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "yxc890123",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/fe/81/70a0408c0e3f6b0574c0d5d3744807eed5352dc79a98c2fcb707bfc4eb72/http_tunnel-0.6.9.tar.gz",
    "platform": null,
    "description": "# http-tunnel\n\nTunneling all sockets by using regular HTTP requests.\n\n## Why\n\nIf you always suffered from the limitations of proxy or firewall that cannot be avoided,\nthen this tool MIGHT be useful for you.\n\n## How it works\n\nIt is a pair of HTTP client/server programs.\nThe client also acts as a server, capturing all incoming sockets and sending them to the server.\nThe server then sends the received socket data to the target server.\n\nAll data between the client and server is encrypted and wrapped in HTTP requests.\n\nHTTPS is supported, but your proxy may block self-signed server certificates.\nEven with a formal certificate, the proxy may still decrypt the SSL/TLS layer by using fake certificates,\nand the data is encrypted (again, by this tool) anyway.\n\nHTTPS may be only necessary for WebSocket since it will connect by using the CONNECT method via proxy,\nwhich is probably not allowed other than HTTPS.\n\nIf there is still any concern, put the server behind a firewall or any reverse proxy that can handle SSL/TLS connections.\n\n## Problems\n\nThe connection WILL be slow, and may not be stable too.\n\nAlthough the WebSocket method can do way better performance than others, it may not be suitable for all situations.\n\nSince HTTP is stateless,\nit's better to use this tool with other \"real\" tunnel protocols, such as SSH, that maintain consistent connections,\notherwise, it may consume a lot of sessions, which is not efficient and might be suspected.\n\n## Requirements\n\n- Python 3.8+\n  - [requests](https://pypi.org/project/requests/), [pysocks](https://pypi.org/project/PySocks/) (for easy client handling)\n  - [fastapi-slim](https://pypi.org/project/fastapi-slim/), [uvicorn](https://pypi.org/project/uvicorn/) (for easy server implementation)\n  - [websockets](https://pypi.org/project/websockets/) (for WebSocket implementation)\n  - [cryptography](https://pypi.org/project/cryptography/)\n- OS: Linux, Windows, MacOS(not tested)\n\n## Installation\n\n```bash\npip install http-tunnel\n```\n\n## Usage\n\n- To start server:\n\n  ```bash\n  http-tunnel -s\n  ```\n\n- To start client:\n\n  ```bash\n  http-tunnel -c\n  ```\n\n  **Note:** To use proxy, set the `HTTP_PROXY` or `HTTPS_PROXY` environment variable.\n\n- For more information:\n\n  ```bash\n  http-tunnel --help\n  ```\n\n## Still working on\n\n1. ~~Support other request methods.~~\n   - [x] ~~POST~~\n   - [x] ~~PUT~~\n   - [x] ~~DELETE~~\n   - [x] ~~PATCH~~\n   - [x] ~~WebSocket~~\n2. Support UDP.\n\n## As always\n\nUse at your own risk and responsibility.\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "HTTP tunneling tool.",
    "version": "0.6.9",
    "project_urls": {
        "Homepage": "https://github.com/yxc890123/http-tunnel"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "16beb398e131b4a949c2009e57ef7c8037464bfeb57645cc9833242b3aeac510",
                "md5": "37d5da19b4191ba952fc2dd156144604",
                "sha256": "2609d034baa8e3350b1c44bd1af6828200dbd5e572bf102530d2b46f3da9d925"
            },
            "downloads": -1,
            "filename": "http_tunnel-0.6.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "37d5da19b4191ba952fc2dd156144604",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 19403,
            "upload_time": "2024-07-19T00:27:33",
            "upload_time_iso_8601": "2024-07-19T00:27:33.131307Z",
            "url": "https://files.pythonhosted.org/packages/16/be/b398e131b4a949c2009e57ef7c8037464bfeb57645cc9833242b3aeac510/http_tunnel-0.6.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fe8170a0408c0e3f6b0574c0d5d3744807eed5352dc79a98c2fcb707bfc4eb72",
                "md5": "d9d7c81d89caaca2c474ee76b04d085a",
                "sha256": "11e359c6f1ceebe452b680c23aeb1512e101bd817ed40be4ec6046268e310664"
            },
            "downloads": -1,
            "filename": "http_tunnel-0.6.9.tar.gz",
            "has_sig": false,
            "md5_digest": "d9d7c81d89caaca2c474ee76b04d085a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 18723,
            "upload_time": "2024-07-19T00:27:34",
            "upload_time_iso_8601": "2024-07-19T00:27:34.786021Z",
            "url": "https://files.pythonhosted.org/packages/fe/81/70a0408c0e3f6b0574c0d5d3744807eed5352dc79a98c2fcb707bfc4eb72/http_tunnel-0.6.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-19 00:27:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yxc890123",
    "github_project": "http-tunnel",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "http-tunnel"
}
        
Elapsed time: 0.79800s