Skip to main content

a safe http proxy over tls

Project description

TlsProxys

基于TLS协议的http流量代理


安装

需要python3.7+

Unix: python3.9 -m pip install TlsProxys
windows: pip install TlsProxys

基本用法

服务器端: $ tpserver [command] [filename] ...

客户端: $ tpclient [command] [filename] ...

命令行参数含义

  • -c : 手动指定配置文件
  • -g : 生成私钥-证书
  • -r : 递归文件搜索
  • -v : 版本信息
  • -h : 帮助信息

举例:

读取config.json作为配置文件:

tpclient -c config.json

生成 app.key app.crt 私钥-证书对:

tpclient -g app.key app.crt

在本目录下递归查找config.json:

tpclient -r config.json

无参数调用

若不带参数地调用tpclient/tpserver且当前目录下不存在config.json, TlsProxys会交互式地读取用户的输入并在本目录下生成一个config.json文件。

注意:客户端和服务器的配置文件略有不同

一般用法

本条目将给出一个比较完整的提示,一般用户可以参考本流程使用TlsProxys。

在本节所有示例中,tpclient运行在本地 tpserver运行在服务器端。

准备工作

首先,用户需要确保机器上安装有openssl库。可用如下命令测试:

openssl version

若打印版本信息,则openssl已经安装。

TlsProxys使用Tls协议传输数据, 服务器上需要私钥-证书对, 首先在本地生成一个私钥,并用它生成自签名证书:

tpclient -g app.key app.crt

TlsProxys会自动调用openssl, 按照提示输入信息。如果调用成功,本目录下会生成 app.key, app.crt两个文件。

在本地,把app.crt导入浏览器根证书列表;把app.keyapp.crt传输到远程服务器。

启动服务

在服务器上, cd到app.keyapp.crt的目录下, 执行:

tpserver

这会启动一个交互式的读取器, 输入示例如下:

server: 255.255.255.255
port: 8000
password: my_password
certificate: app.crt
private-key: app.key

若解释器没有抛出异常, 命令行应该打印:
255.255.255.255:8000 is serving

在本地, 执行:

tpclient

在交互式读取器内输入:

server: 255.255.255.255
port: 8000
password: my_password
local_port: 8080

若解释器没有抛出异常, 命令行应该打印:
127.0.0.1:8080 is serving

最后修改浏览器代理配置: 地址: 127.0.0.1
端口: 8080

Done.

LICENSE

GPLv3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

TlsProxys-1.0.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

TlsProxys-1.0.1-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file TlsProxys-1.0.1.tar.gz.

File metadata

  • Download URL: TlsProxys-1.0.1.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for TlsProxys-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d3c08de76602bbe8c1733905532e184a03a17a4c6aaae5b64ee1b348de9b7efc
MD5 32e17db5554e27dae60c8058f082935b
BLAKE2b-256 1b5f7f8909503e780dd771931a32e09656e34ef12bf574d6b1a6ce4efb85dc6a

See more details on using hashes here.

File details

Details for the file TlsProxys-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: TlsProxys-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for TlsProxys-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4432d74c936d004e59a70f7ddd063ea1a46c28b12980ddca09d5fb8e4dcb58aa
MD5 5cee251c71a383516dd5c57c0c2fcbc8
BLAKE2b-256 540d6a6977ed3930f1ec01cf1e113e267ce405671b787dc2042743b402dff3b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page