toh
v0.14.2
ToH
— это TCP/UDP через HTTP/WebSocket. Короче говоря, проксируйте свою сеть через WebSocket.
pf
действующий как клиент ToHs5
действует как клиент ToHtohdroid
действует как клиент ToH$ git clone https://github.com/rkonfj/toh.git
$ make linux
$ ./toh serve
time= " 2023-04-26T21:49:33+08:00 " level=info msg= " initializing acl file acl.json "
{
" keys " : [
{
" name " : " default " ,
" key " : " 112qcPA4xPxh7PQV3fyTMEkfByEEn84EjNeMmskVTBVy2aCa4ipX "
}
]
}
time= " 2023-04-26T21:49:33+08:00 " level=info msg= " acl: load 1 keys "
time= " 2023-04-26T21:49:33+08:00 " level=info msg= " server listen on 127.0.0.1:9986 now "
key
здесь будет использоваться командамиpf
иs5
$ caddy reverse-proxy --from https://fill-in-your-server-here.toh.sh --to localhost:9986
server {
listen 443 ssl;
server_name fill-in-your-server-here.toh.sh;
ssl_certificate tls.crt;
ssl_certificate_key tls.key;
location /ws {
proxy_pass http://localhost:9986;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
}
}
pf
действующий как клиент ToH $ # get a chatgpt robot
$ ssh -o ProxyCommand="./toh pf -s https://fill-in-your-server-here.toh.sh/ws -k 112qcPA4xPxh7PQV3fyTMEkfByEEn84EjNeMmskVTBVy2aCa4ipX -f tcp/%h:%p" [email protected]
$ ./toh pf -s https://fill-in-your-server-here.toh.sh/ws -k 112qcPA4xPxh7PQV3fyTMEkfByEEn84EjNeMmskVTBVy2aCa4ipX -f udp/127.0.0.53:53/8.8.8.8:53 -f tcp/0.0.0.0:1080/google.com:80
time= " 2023-04-28T13:52:31+08:00 " level=info msg= " listen on 127.0.0.53:53 for udp://8.8.8.8:53 now "
time= " 2023-04-28T13:52:31+08:00 " level=info msg= " listen on 0.0.0.0:1080 for tcp://google.com:80 now "
$ # run in another shell
$ dig @127.0.0.53 www.google.com +short
142.250.68.4
$ curl 127.0.0.1:8080
< HTML><HEAD><meta http-equiv= " content-type " content= " text/html;charset=utf-8 " >
< TITLE > 301 Moved < /TITLE></HEAD><BODY >
< H 1> 301 Moved < /H 1>
The document has moved
< A HREF= " http://www.google.com:8080/ " > here < /A > .
< /BODY></HTML >
s5
действует как клиент ToH $ ./toh s5
time= " 2023-05-12T15:02:11Z " level=info msg= " initializing config file /root/.config/toh/socks5.yml "
listen: 127.0.0.1:2080
servers:
- name: us1
api: https://fill-in-your-server-here.toh.sh/ws
key: 112qcPA4xPxh7PQV3fyTMEkfByEEn84EjNeMmskVTBVy2aCa4ipX
ruleset:
- https://raw.githubusercontent.com/rkonfj/toh/main/ruleset.txt
time= " 2023-05-12T15:02:11Z " level=info msg= " downloading https://raw.githubusercontent.com/rkonfj/toh/main/ruleset.txt "
time= " 2023-05-12T15:02:14Z " level=info msg= " ruleset us1: special 0, direct 0, wildcard 21 "
time= " 2023-05-12T15:02:14Z " level=info msg= " total loaded 1 proxy servers and 0 groups "
time= " 2023-05-12T15:02:14Z " level=info msg= " downloading /root/.config/toh/country.mmdb (this can take up to 5m0s) "
time= " 2023-05-12T15:05:17Z " level=info msg= " listen on 127.0.0.1:2080 for socks5+http now "
$ # run in another shell
$ https_proxy=socks5://127.0.0.1:2080 curl https://api64.ipify.org
104.207.152.45
$ # wow, great! the `104.207.152.45` is your proxy ip
CONNECT
и UDP ASSOCIATE
us1
— тестовый сервер, в будущем он будет остановленtohdroid
действует как клиент ToHподробности см. в проекте tohdroid