Skip to main content

a safe http proxy over tls

Project description

TlsProxys

基于TLS协议的http流量代理


安装

需要python3.7+

linux: sudo python3 -m pip install TlsProxys
windows: pip install TlsProxys

基本用法

服务器端:

$ tpserver [command] [filename1[, filename2]]

客户端:

$ tpclient [command] [filename1[, filename2]]

命令行参数含义

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: TlsProxys-1.0.5.tar.gz
  • Upload date:
  • Size: 20.3 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.5.tar.gz
Algorithm Hash digest
SHA256 8b0fc2a08aad24a3de5a205a33aee6cdc29075c2d1cbe16e95473dffd75fd4a6
MD5 aa2126666ff837dddfc0eb0f4befbe01
BLAKE2b-256 be3320ea2ea0fb361b4cc1104e3726a732d93809284bfc19e618c167edeaae06

See more details on using hashes here.

File details

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

File metadata

  • Download URL: TlsProxys-1.0.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e0e1f999e275fbdbe53482b7aefd8592f4bf5ec67d7d0d6b1334add8b57cdb04
MD5 103e0fe00283e13f355422b198036766
BLAKE2b-256 8c89efaf2ef90205a64ceeb15cdfa233f63e44684564872ec69b7164710fe4e9

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