{"id":14563565,"url":"https://github.com/ao-space/gt","last_synced_at":"2025-04-04T20:10:44.985Z","repository":{"id":57640873,"uuid":"432889295","full_name":"ao-space/gt","owner":"ao-space","description":"Fast WebSocket(s)/HTTP(s)/TCP relay proxy for making tunnels to localhost. ","archived":false,"fork":false,"pushed_at":"2024-10-30T00:37:47.000Z","size":1578,"stargazers_count":128,"open_issues_count":5,"forks_count":36,"subscribers_count":13,"default_branch":"dev","last_synced_at":"2025-03-28T19:08:04.251Z","etag":null,"topics":["dev","fast","firewall","http","nat","p2p","proxy","relay","remote","tcp","tunnel","websocket"],"latest_commit_sha":null,"homepage":"https://ao.space","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ao-space.png","metadata":{"files":{"readme":"README.en.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,"publiccode":null,"codemeta":null}},"created_at":"2021-11-29T03:09:56.000Z","updated_at":"2025-03-04T03:16:21.000Z","dependencies_parsed_at":"2023-11-22T06:29:57.667Z","dependency_job_id":"9254d5ff-84fd-46bb-9075-b9a1579ada35","html_url":"https://github.com/ao-space/gt","commit_stats":null,"previous_names":["isrc-cas/gt"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ao-space%2Fgt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ao-space%2Fgt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ao-space%2Fgt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ao-space%2Fgt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ao-space","download_url":"https://codeload.github.com/ao-space/gt/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242678,"owners_count":20907134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["dev","fast","firewall","http","nat","p2p","proxy","relay","remote","tcp","tunnel","websocket"],"created_at":"2024-09-07T02:03:09.260Z","updated_at":"2025-04-04T20:10:44.970Z","avatar_url":"https://github.com/ao-space.png","language":"Go","readme":"[简体中文](./README.md) | English\n\n\u003ch1 align=\"center\"\u003eGT\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n\nA fast WebSocket(s)/HTTP(s)/TCP relay proxy with WebRTC P2P supports.\n\n[![GitHub (pre-)release](https://img.shields.io/github/release/ao-space/gt/all.svg)](https://github.com/ao-space/gt/releases) [![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/ao-space/gt/.github%2Fworkflows%2Fcontainer.yml)](https://github.com/ao-space/gt/actions) [![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/ao-space/gt/total)](https://github.com/ao-space/gt/releases) [![GitHub issues](https://img.shields.io/github/issues/ao-space/gt.svg)](https://github.com/ao-space/gt/issues) [![GitHub closed issues](https://img.shields.io/github/issues-closed/ao-space/gt.svg)](https://github.com/ao-space/gt/issues?q=is%3Aissue+is%3Aclosed) [![GitHub](https://img.shields.io/github/license/ao-space/gt.svg)](./LICENSE)\n\n\u003c/div\u003e\n\n**Key Design Features:**\n\n- **Stability**\n  - Highly available, can upgrade versions on the fly without worrying about connection loss, service interruptions, or downtime.\n  - During reload, forwarding is maintained successfully. During stress testing, reload resulted in 0 errors.\n  - Process supervision ensures that worker processes automatically restart if they crash.\n\n- **Performance**\n  - Aiming for higher performance while maintaining cross-platform compatibility, employing more efficient technical solutions.\n  - Minimize memory allocation to ease the burden on the garbage collector: use resource pools; instantiate a Value in LoadOrStore only during the Store operation.\n  - Minimize memory copying: Reader uses Peek and Discard instead of Read.\n  - Avoid system calls: Virtual Listener and Conn forward request data to in-process API services.\n  - Utilize appropriate concurrency techniques for different concurrency scenarios.\n\n- **Usability**\n  - Supports web-based configuration management.\n  - Zero-parameter startup initiates web configuration setup.\n  - Supports loading configuration file directories, allowing simultaneous startup of multiple servers and clients.\n  - Clients can point to multiple services.\n  - Server supports multi-user functionality.\n  - Clients intelligently choose the communication protocol with the server based on network conditions.\n\n- **Privacy Protection**\n  - The server's port reuse feature is based on the characteristic position of the protocol target. For instance, when forwarding HTTP protocol at the application layer, it is based on the TCP data stream, targeting only the first packet's HTTP protocol header for forwarding, then directly forwarding subsequent data.\n  - Does not log sensitive information.\n  - Supports HTTPS SNI for end-to-end encryption forwarding.\n\n## Working Principle\n\n```text\n      ┌──────────────────────────────────────┐\n      │  Web    Android     iOS    PC    ... │\n      └──────────────────┬───────────────────┘\n                  ┌──────┴──────┐\n                  │  GT Server  │\n                  └──────┬──────┘\n       ┌─────────────────┼─────────────────┐\n┌──────┴──────┐   ┌──────┴──────┐   ┌──────┴──────┐\n│  GT Client  │   │  GT Client  │   │  GT Client  │ ...\n└──────┬──────┘   └──────┬──────┘   └──────┬──────┘\n┌──────┴──────┐   ┌──────┴──────┐   ┌──────┴──────┐\n│     SSH     │   │   HTTP(S)   │   │     SMB     │ ...\n└─────────────┘   └─────────────┘   └─────────────┘\n```\n\n## Download\n\n### Github\n\nChoose the appropriate version to download from [https://github.com/ao-space/gt/releases](https://github.com/ao-space/gt/releases).\n\n### Docker Container\n\nMore container image information can be found at [https://github.com/ao-space/gt/pkgs/container/gt](https://github.com/ao-space/gt/pkgs/container/gt).\n\n```shell\ndocker pull ghcr.io/ao-space/gt:server-dev\n\ndocker pull ghcr.io/ao-space/gt:client-dev\n```\n\n## Usage\n\n```shell\ngt --help\nFast WebSocket(s)/HTTP(s)/TCP relay proxy with WebRTC P2P supports.\n\nUsage: gt [OPTIONS] [COMMAND]\n\nCommands:\n  server  Run GT Server\n  client  Run GT Client\n  help    Print this message or the help of the given subcommand(s)\n\nOptions:\n  -c, --config \u003cCONFIG\u003e\n          Path to the config file or the directory containing the config files\n\n  -s, --signal \u003cSIGNAL\u003e\n          Send signal to the running GT processes\n\n          Possible values:\n          - reload:  Send reload signal\n          - restart: Send restart signal\n          - stop:    Send stop signal\n\n  -h, --help\n          Print help (see a summary with '-h')\n\n  -V, --version\n          Print version\n```\n\n## Configuration File\n\nConfiguration files can be edited and generated through the web management backend.\n\n### Server\n\nRun with default configuration, after which you can obtain the web management backend address from the logs, open it with a browser, and edit the configuration items:\n\n```shell\ngt server\n```\n\nRun with a specified configuration file:\n\n```shell\ngt server -c ./config.yml\n```\n\n### Client\n\nRun with default configuration, after which you can obtain the web management backend address from the logs, open it with a browser, and edit the configuration items:\n\n```shell\ngt client\n```\n\nRun with a specified configuration file:\n\n```shell\ngt client -c ./config.yml\n```\n\n### Batch Startup\n\nBatch startup by specifying the configuration file directory:\n\n```shell\ngt -c ./conf.d\n```\n\n## Performance Testing\n\n### Group 1 (MacOS Environment + Nginx Test)\n\nStress test comparison between this project and frp using wrk, with the internal network service pointing to the local nginx test page, results as follows:\n\n```text\nModel Name: MacBook Pro\nModel Identifier: MacBookPro17,1\nChip: Apple M1\nTotal Number of Cores: 8 (4 performance and 4 efficiency)\nMemory: 16 GB\n```\n\n#### GT Benchmark\n\n```shell\n$ wrk -c 100 -d 30s -t 10 http://pi.example.com:7001\nRunning 30s test @ http://pi.example.com:7001\n  10 threads and 100 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     2.22ms  710.73us  37.99ms   98.30%\n    Req/Sec     4.60k   231.54     4.86k    91.47%\n  1374783 requests in 30.01s, 1.09GB read\nRequests/sec:  45811.08\nTransfer/sec:     37.14MB\n\n$ ps aux\n  PID  %CPU %MEM      VSZ    RSS   TT  STAT STARTED      TIME COMMAND\n 2768   0.0  0.1 408697792  17856 s008  S+    4:55PM   0:52.34 ./client -local http://localhost:8080 -remote tcp://localhost:7001 -id pi -threads 3\n 2767   0.0  0.1 408703664  17584 s007  S+    4:55PM   0:52.16 ./server -port 7001\n```\n\n#### frp dev branch 42745a3\n\n```shell\n$ wrk -c 100 -d 30s -t 10 http://pi.example.com:7000\nRunning 30s test @ http://pi.example.com:7000\n  10 threads and 100 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency    76.92ms   73.46ms 748.61ms   74.21%\n    Req/Sec   154.63    308.28     2.02k    93.75%\n  45487 requests in 30.10s, 31.65MB read\n  Non-2xx or 3xx responses: 20610\nRequests/sec:   1511.10\nTransfer/sec:      1.05MB\n\n$ ps aux\n  PID  %CPU %MEM      VSZ    RSS   TT  STAT STARTED      TIME COMMAND\n 2975   0.3  0.5 408767328  88768 s004  S+    5:01PM   0:21.88 ./frps -c ./frps.ini\n 2976   0.0  0.4 408712832  66112 s005  S+    5:01PM   1:06.51 ./frpc -c ./frpc.ini\n```\n\n### Group 2 (Ubuntu Environment + Nginx Test)\n\nStress test comparison between this project and frp using wrk, with the internal network service pointing to the local nginx test page, results as follows:\n\n```text\nSystem: Ubuntu 22.04\nChip: Intel i9-12900\nTotal Number of Cores: 16 (8 performance and 8 efficiency)\nMemory: 32 GB\n```\n\n#### GT-TCP\n\n```shell\n$ ./release/linux-amd64-server -addr 12080 -id id1 -secret secret1\n$ ./release/linux-amd64-client -local http://127.0.0.1:80 -remote tcp://id1.example.com:12080 -id id1 -secret secret1\n\n$ wrk -c 100 -d 30s -t 10 http://id1.example.com:12080\nRunning 30s test @ http://id1.example.com:12080\n  10 threads and 100 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency   558.51us    2.05ms  71.54ms   99.03%\n    Req/Sec    24.29k     2.28k   49.07k    95.74%\n  7264421 requests in 30.10s, 5.81GB read\nRequests/sec: 241344.46\nTransfer/sec:    197.70MB\n```\n\n#### GT-QUIC\n\n```shell\n$ ./release/linux-amd64-server -addr 12080 -quicAddr 443 -certFile /root/openssl_crt/tls.crt -keyFile /root/openssl_crt/tls.key -id id1 -secret secret1\n$ ./release/linux-amd64-client -local http://127.0.0.1:80 -remote quic://id1.example.com:443 -remoteCertInsecure -id id1 -secret secret1\n\n$ wrk -c 100 -d 30s -t 10 http://id1.example.com:12080\nRunning 30s test @ http://id1.example.com:12080\n  10 threads and 100 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency   826.65us    1.14ms  66.29ms   98.68%\n    Req/Sec    12.91k     1.36k   23.53k    79.43%\n  3864241 requests in 30.10s, 3.09GB read\nRequests/sec: 128380.49\nTransfer/sec:    105.16MB\n```\n\n#### frp v0.52.1\n\n```shell\n$ ./frps -c ./frps.toml\n$ ./frpc -c ./frpc.toml\n\n$ wrk -c 100 -d 30s -t 10 http://id1.example.com:12080/\nRunning 30s test @ http://id1.example.com:12080/\n  10 threads and 100 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     4.49ms    8.27ms 154.62ms   92.43%\n    Req/Sec     4.02k     2.08k    7.51k    53.21%\n  1203236 requests in 30.08s, 0.93GB read\nRequests/sec:  40003.03\nTransfer/sec:     31.82MB\n```\n\n### Group 3 (Ubuntu Environment + Short Request Test)\n\nStress test comparison between this project and frp using wrk, where each request only returns a field response of less than 10 bytes, simulating HTTP short requests, results as follows:\n\n#### GT-TCP\n\n```shell\n$ ./release/linux-amd64-server -addr 12080 -id id1 -secret secret1\n$ ./release/linux-amd64-client -local http://127.0.0.1:80 -remote tcp://id1.example.com:12080 -id id1 -secret secret1\n\n$ wrk -c 100 -d 30s -t 10 http://id1.example.com:12080/\nRunning 30s test @ http://id1.example.com:12080/\n  10 threads and 100 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     4.55ms   13.48ms 220.23ms   95.31%\n    Req/Sec     5.23k     2.11k   12.40k    76.10%\n  1557980 requests in 30.06s, 191.67MB read\nRequests/sec:  51822.69\nTransfer/sec:      6.38MB\n```\n\n#### GT-QUIC\n\n```shell\n$ ./release/linux-amd64-server -addr 12080 -quicAddr 443 -certFile /root/openssl_crt/tls.crt -keyFile /root/openssl_crt/tls.key -id id1 -secret secret1\n$ ./release/linux-amd64-client -local http://127.0.0.1:80 -remote quic://id1.example.com:443 -remoteCertInsecure -id id1 -secret secret1\n\n$ wrk -c 100 -d 30s -t 10 http://id1.example.com:12080/\nRunning 30s test @ http://id1.example.com:12080/\n  10 threads and 100 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     1.84ms    6.75ms 168.93ms   98.47%\n    Req/Sec     9.33k     2.13k   22.86k    78.54%\n  2787908 requests in 30.10s, 342.98MB read\nRequests/sec:  92622.63\nTransfer/sec:     11.39MB\n```\n\n#### frp v0.52.1\n\n```shell\n$ ./frps -c ./frps.toml\n$ ./frpc -c ./frpc.toml\n\n$ wrk -c 100 -d 30s -t 10 http://id1.example.com:12080/\nRunning 30s test @ http://id1.example.com:12080/\n  10 threads and 100 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     2.95ms    3.74ms 136.09ms   91.10%\n    Req/Sec     4.16k     1.22k   12.86k    87.85%\n  1243103 requests in 30.07s, 152.93MB read\nRequests/sec:  41334.52\nTransfer/sec:      5.09MB\n```\n\n## Community\n\nWelcome to join the [Slack](https://slack.ao.space) channel for discussions.\n\n## Contributors\n\nThank you to the following developers for their contributions to the project:\n\n- [zhiyi](https://github.com/vyloy)\n- [jianti](https://github.com/FH0)\n- [huwf5](https://github.com/huwf5)\n- [AdachiAndShimamura](https://github.com/AdachiAndShimamura)\n- [DrakenLibra](https://github.com/DrakenLibra)\n","funding_links":[],"categories":["websocket"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fao-space%2Fgt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fao-space%2Fgt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fao-space%2Fgt/lists"}