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.2.tar.gz (7.7 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.2-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: TlsProxys-1.0.2.tar.gz
  • Upload date:
  • Size: 7.7 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.2.tar.gz
Algorithm Hash digest
SHA256 7919168beb4fc4eeb7caf6b883d6d1c8ac92d700988f634c2c8c0a42fecbf50b
MD5 84f3c23d67594ccdb686a0c4d4617f33
BLAKE2b-256 34b216a812449bcfdca91cf965c3b8910c5ec65bfc55b634ed6ebf11df215999

See more details on using hashes here.

File details

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

File metadata

  • Download URL: TlsProxys-1.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f48a2b63c36a20eb92449ee0b845d4bd7efe10513228c61ce2dd08e5400b2f14
MD5 8024c0f2762be39b55afbf7ee050cbfa
BLAKE2b-256 2f84673debdb2b687ab61844ffea3b6f6b4c8d248dc938357eb424b8632b98c7

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