7个版本
0.1.6 | 2019年2月26日 |
---|---|
0.1.5 | 2019年2月21日 |
#23 在 #socks5
每月44次下载
15KB
137 行
cleartor
一个简单的代理,用于将明网流量转发到洋葱URL。
此用例是在防火墙后面托管服务器,该服务器仅通过洋葱地址公开,并托管一个(匿名)轻量级VPS,将所有通过常规DNS地址接收的流量转发到服务器。
它与web2tor类似,但仅转发到1个特定的洋葱链接。
cleartor
在调试模式下运行时不会记录任何内容。
安装
您至少需要 libc
、pkg-config
和 openssl
来构建,以及 tor
来运行
sudo apt install build-essential pkg-config libssl-dev tor
要安装cleartor,只需运行
cargo install cleartor
以下内容应添加到 /etc/tor/torrc
# The port cleartor will bind on
SocksPort 9050
# Only allow local traffic
SocksPolicy accept 127.0.0.1/16
SocksPolicy reject *
更改配置后,重新启动Tor服务
sudo service tor restart
用法
使用 /etc/cleartor.toml
中的配置
./cleartor
使用其他配置
./cleartor -c other-location/cleartor.toml
在后台运行它并永不退出
nohup cleartor > /dev/null 2>&1 &
以非root用户运行它并仍能绑定到端口80
sudo apt install libcap2-bin
sudo setcap 'cap_net_bind_service=+ep' ~/.cargo/bin/cleartor
示例配置
/etc/cleartor.toml
:
# The address and port to listen on
# 0.0.0.0 to listen to all connections
# 127.0.0.1 to listen to local only connections
listen_ip = "0.0.0.0"
# Set the port to 0 to receive a port from the OS
listen_port = 80
# The socks port as defined as 'SocksPort' in /etc/tor/torrc, without the address
tor_socks_port = 9050
# This section is optional
[log]
# Where to save the log
file = "/var/log/cleartor.log"
# What to log
file_level = "DEBUG"
# What to print to the console
print_level = "INFO"
[[routes]]
# The LOCATION HTTP header will be replaced with this instead of the .onion URL when you receive a response
# This field is probably misconfigured if forms aren't working
domain = "torproject.org"
# The onion address to forward all traffic to
onion = "expyuzz4wqqyqhjn.onion"
[[routes]]
# Alternatively you can also add an IP here to route specific traffic (or to test when the DNS is not available)
domain = "127.0.0.1"
onion = "expyuzz4wqqyqhjn.onion"
运行方式
sudo cleartor -c /etc/cleartor.toml
许可证
许可协议为AGPLv3。
依赖项
~11MB
~184K SLoC