{"id":37206575,"url":"https://github.com/rkonfj/toh","last_synced_at":"2026-01-14T23:46:37.000Z","repository":{"id":153796354,"uuid":"629800215","full_name":"rkonfj/toh","owner":"rkonfj","description":"TCP/UDP over HTTP/WebSocket 💪","archived":false,"fork":false,"pushed_at":"2024-04-21T03:15:05.000Z","size":596,"stargazers_count":26,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-31T07:32:16.553Z","etag":null,"topics":["firewall","golang","network","overlay","proxy","socks5","tcp","toh","tunnel","udp","websocket"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rkonfj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-04-19T03:48:13.000Z","updated_at":"2025-05-27T07:53:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"57161162-fe4b-4478-aa79-818184ad0430","html_url":"https://github.com/rkonfj/toh","commit_stats":null,"previous_names":["nasuci/toh","cherrydra/toh","rkonfj/toh"],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/rkonfj/toh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkonfj%2Ftoh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkonfj%2Ftoh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkonfj%2Ftoh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkonfj%2Ftoh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rkonfj","download_url":"https://codeload.github.com/rkonfj/toh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkonfj%2Ftoh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28439537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firewall","golang","network","overlay","proxy","socks5","tcp","toh","tunnel","udp","websocket"],"created_at":"2026-01-14T23:46:36.312Z","updated_at":"2026-01-14T23:46:36.985Z","avatar_url":"https://github.com/rkonfj.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n`ToH` is TCP/UDP over HTTP/WebSocket. In short, proxy your network over WebSocket\n![connect to refused nodes](overview.png)\n## Table of contents\n- [ToH server](#toh-server)\n- [Caddy or Nginx wrap ToH server with TLS](#caddy-or-nginx-wrap-toh-server-with-tls)\n- [Port-forward tool `pf` act as ToH client](#port-forward-tool-pf-act-as-toh-client)\n- [Socks5+http proxy server `s5` act as ToH client](#socks5http-proxy-server-s5-act-as-toh-client)\n- [Android project `tohdroid` act as ToH client](#android-project-tohdroid-act-as-toh-client)\n\n### ToH server\n- Build\n```sh\n$ git clone https://github.com/rkonfj/toh.git\n$ make linux\n```\n\n- Run\n```sh\n$ ./toh serve\ntime=\"2023-04-26T21:49:33+08:00\" level=info msg=\"initializing acl file acl.json\"\n{\n    \"keys\": [\n        {\n            \"name\": \"default\",\n            \"key\": \"112qcPA4xPxh7PQV3fyTMEkfByEEn84EjNeMmskVTBVy2aCa4ipX\"\n        }\n    ]\n}\ntime=\"2023-04-26T21:49:33+08:00\" level=info msg=\"acl: load 1 keys\"\ntime=\"2023-04-26T21:49:33+08:00\" level=info msg=\"server listen on 127.0.0.1:9986 now\"\n```\n\u003e the `key` here will using by `pf` and `s5` commands\n\n### Caddy or Nginx wrap ToH server with TLS\n- Caddy\n```sh\n$ caddy reverse-proxy --from https://fill-in-your-server-here.toh.sh --to localhost:9986\n```\n\n- Nginx\n```\nserver {\n\tlisten 443 ssl;\n\tserver_name fill-in-your-server-here.toh.sh;\n\n\tssl_certificate     tls.crt;\n\tssl_certificate_key tls.key;\n\n\tlocation /ws {\n\t\tproxy_pass http://localhost:9986;\n\t\tproxy_set_header Host $host;\n\t\tproxy_set_header X-Real-IP $remote_addr;\n\t\tproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n\t\tproxy_http_version 1.1;\n\t\tproxy_set_header Upgrade $http_upgrade;\n\t\tproxy_set_header Connection upgrade;\n\t}\n}\n```\n### Port forward tool `pf` act as ToH client\n- SSH over HTTP\n```\n$ # get a chatgpt robot\n$ ssh -o ProxyCommand=\"./toh pf -s https://fill-in-your-server-here.toh.sh/ws -k 112qcPA4xPxh7PQV3fyTMEkfByEEn84EjNeMmskVTBVy2aCa4ipX -f tcp/%h:%p\" chat@127.0.0.1\n```\n- Common use case\n```sh\n$ ./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\ntime=\"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\"\ntime=\"2023-04-28T13:52:31+08:00\" level=info msg=\"listen on 0.0.0.0:1080 for tcp://google.com:80 now\"\n\n$ # run in another shell\n$ dig @127.0.0.53 www.google.com +short\n142.250.68.4\n\n$ curl 127.0.0.1:8080\n\u003cHTML\u003e\u003cHEAD\u003e\u003cmeta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\"\u003e\n\u003cTITLE\u003e301 Moved\u003c/TITLE\u003e\u003c/HEAD\u003e\u003cBODY\u003e\n\u003cH1\u003e301 Moved\u003c/H1\u003e\nThe document has moved\n\u003cA HREF=\"http://www.google.com:8080/\"\u003ehere\u003c/A\u003e.\n\u003c/BODY\u003e\u003c/HTML\u003e\n```\n\n### Socks5+http proxy server `s5` act as ToH client\n```sh\n$ ./toh s5\ntime=\"2023-05-12T15:02:11Z\" level=info msg=\"initializing config file /root/.config/toh/socks5.yml\"\nlisten: 127.0.0.1:2080\nservers:\n  - name: us1\n    api: https://fill-in-your-server-here.toh.sh/ws\n    key: 112qcPA4xPxh7PQV3fyTMEkfByEEn84EjNeMmskVTBVy2aCa4ipX\n    ruleset:\n      - https://raw.githubusercontent.com/rkonfj/toh/main/ruleset.txt\ntime=\"2023-05-12T15:02:11Z\" level=info msg=\"downloading https://raw.githubusercontent.com/rkonfj/toh/main/ruleset.txt\"\ntime=\"2023-05-12T15:02:14Z\" level=info msg=\"ruleset   us1: special 0, direct 0, wildcard 21\"\ntime=\"2023-05-12T15:02:14Z\" level=info msg=\"total loaded 1 proxy servers and 0 groups\"\ntime=\"2023-05-12T15:02:14Z\" level=info msg=\"downloading /root/.config/toh/country.mmdb (this can take up to 5m0s)\"\ntime=\"2023-05-12T15:05:17Z\" level=info msg=\"listen on 127.0.0.1:2080 for socks5+http now\"\n\n$ # run in another shell\n$ https_proxy=socks5://127.0.0.1:2080 curl https://api64.ipify.org\n104.207.152.45\n$ # wow, great! the `104.207.152.45` is your proxy ip\n```\n- full configuration can be viewed [here](https://github.com/rkonfj/toh/blob/main/cmd/s5/server/config.go)  \n- socks5 support `CONNECT` and `UDP ASSOCIATE`\n- the server `us1` is the test server, will stopped in the future\n\n### Android project `tohdroid` act as ToH client\nsee project [tohdroid](https://github.com/rkonfj/tohdroid) for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkonfj%2Ftoh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frkonfj%2Ftoh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkonfj%2Ftoh/lists"}