็ฎไฝไธญๆ | English
ๅ ณ้ฎ่ฎพ่ฎก็น็น๏ผ
- ๆณจ้็จณๅฎๆง
- ้ซๅฏ็จ๏ผๅฏไปฅๅจ่ฟ่กๆถๅ็บง็ๆฌ๏ผๆ ้ๆ ๅฟ่ฟๆฅไธขๅคฑใๆๅกไธญๆญใๅๆบ
- ๅจ reload ่ฟ็จไธญ๏ผไผไฟๆ่ฝฌๅๅฏไปฅๆๅใๅๅๆต่ฏ่ฟ็จไธญ reload๏ผๆต่ฏ็ปๆ 0 error
- ่ฟ็จๅฎๆค๏ผๅทฅไฝ่ฟ็จๅดฉๆบ่ชๅจ้ๅฏ
- ๆณจ้ๆง่ฝ๏ผๅจไฟๆ่ทจๅนณๅฐ็ๅๆไธ๏ผไผๅฐ่ฏ้็จๆง่ฝๆด้ซ็ๆๆฏๆนๆก
- ๅๅฐๅ ๅญๅ้ ๆฅๅ่ฝป GC ่ดๆ ๏ผ่ตๆบๆฑ ๏ผLoadOrStore ไป ๅจ Store ๆถๆๅๅปบ Value
- ๅๅฐๅ ๅญๅคๅถ๏ผReader ไฝฟ็จ Peek ๅ Discard ๅไปฃ Read
- ้ฟๅ ็ณป็ป่ฐ็จ๏ผVirtual ListenerใConn ๅฐ่ฏทๆฑๆฐๆฎ่ฝฌๅๅฐ่ฟ็จๅ API ๆๅก
- ๆ นๆฎไธๅ็ๅนถๅๅบๆฏ๏ผไฝฟ็จ้ๅฝ็ๅนถๅๆๆฏ
- ๆณจ้ๆ็จๆง
- ๆฏๆ Web ้ ็ฝฎ็ฎก็
- ้ถๅๆฐ้ ็ฝฎๅฏๅจ๏ผ่ฟๅ ฅ Web ้ ็ฝฎๅๅงๅ
- ๆฏๆๅ ่ฝฝ้ ็ฝฎๆไปถ็ฎๅฝ๏ผๅฏไปฅๅๆถๅฏๅจๅคไธชๆๅก็ซฏๅๅฎขๆท็ซฏ
- ๅฎขๆท็ซฏๆฏๆๆๅๅคไธชๆๅก
- ๆๅก็ซฏๆฏๆๅค็จๆทๅ่ฝ
- ๅฎขๆท็ซฏ่ชๅจๆ นๆฎ็ฝ็ป็ถๅต๏ผๆบ่ฝ้ๆฉไธๆๅก็ซฏ็้ไฟกๅ่ฎฎ
- ๆณจ้้็งไฟๆค
- ๆๅก็ซฏ็็ซฏๅฃๅค็จๅ่ฝ๏ผๆฏๅบไบๅ่ฎฎ็ฎๆ ็็นๅพไฝ็ฝฎๆฅๅฎ็ฐ็ใไพๅฆ๏ผๅบ็จๅฑ HTTP ๅ่ฎฎ่ฝฌๅ๏ผๅบไบ TCP ๆฐๆฎๆต๏ผๅชๅฎไฝ่ทๅ็ฌฌไธไธชๆฐๆฎๅ ็ HTTP ๅ่ฎฎๅคด็่ฝฌๅ็ฎๆ ๏ผ็ถๅๅฐๅ็ปญๆฐๆฎ็ดๆฅ่ฝฌๅ
- ไธๆๅฐๆๆไฟกๆฏๅฐๆฅๅฟ
- ๆฏๆ HTTPS SNI ็ซฏๅฐ็ซฏๅ ๅฏ่ฝฌๅ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Web Android iOS PC ... โ
โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโดโโโโโโโ
โ GT Server โ
โโโโโโโโฌโโโโโโโ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโ
โโโโโโโโดโโโโโโโ โโโโโโโโดโโโโโโโ โโโโโโโโดโโโโโโโ
โ GT Client โ โ GT Client โ โ GT Client โ ...
โโโโโโโโฌโโโโโโโ โโโโโโโโฌโโโโโโโ โโโโโโโโฌโโโโโโโ
โโโโโโโโดโโโโโโโ โโโโโโโโดโโโโโโโ โโโโโโโโดโโโโโโโ
โ SSH โ โ HTTP(S) โ โ SMB โ ...
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
ไป https://github.com/ao-space/gt/releases ้ๆฉๅ้็็ๆฌไธ่ฝฝใ
ๆดๅคๅฎนๅจ้ๅไฟกๆฏๅฏไปฅไป https://github.com/ao-space/gt/pkgs/container/gt ่ทๅใ
docker pull ghcr.io/ao-space/gt:server-dev
docker pull ghcr.io/ao-space/gt:client-dev
gt --help
Fast WebSocket(s)/HTTP(s)/TCP relay proxy with WebRTC P2P supports.
Usage: gt [OPTIONS] [COMMAND]
Commands:
server Run GT Server
client Run GT Client
help Print this message or the help of the given subcommand(s)
Options:
-c, --config <CONFIG>
Path to the config file or the directory contains the config files
-s, --signal <SIGNAL>
Send signal to the running GT processes
Possible values:
- reload: Send reload signal
- restart: Send restart signal
- stop: Send stop signal
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
้ ็ฝฎๆไปถๅฏไปฅ้่ฟ Web ็ฎก็ๅๅฐ็ผ่พ็ๆ๏ผๆจ่็ดๆฅไฝฟ็จ Web ็ฎก็ๅๅฐ็ผ่พใ
ไฝฟ็จ้ป่ฎค้ ็ฝฎ่ฟ่ก๏ผ่ฟ่กๅๅฏไปๆฅๅฟ่ทๅ Web ็ฎก็ๅๅฐๅฐๅ๏ผ็จๆต่งๅจๆๅผๅ๏ผ่ฟ่ก้ ็ฝฎ้กน็ผ่พ๏ผ
gt server
้่ฟๆๅฎ้ ็ฝฎๆไปถ่ฟ่ก๏ผ
gt server -c ./config.yml
ไฝฟ็จ้ป่ฎค้ ็ฝฎ่ฟ่ก๏ผ่ฟ่กๅๅฏไปๆฅๅฟ่ทๅ Web ็ฎก็ๅๅฐๅฐๅ๏ผ็จๆต่งๅจๆๅผๅ๏ผ่ฟ่ก้ ็ฝฎ้กน็ผ่พ๏ผ
gt client
้่ฟๆๅฎ้ ็ฝฎๆไปถ่ฟ่ก๏ผ
gt client -c ./config.yml
้่ฟๆๅฎ้ ็ฝฎๆไปถ็ฎๅฝๆน้ๅฏๅจ๏ผ
gt -c ./conf.d
้่ฟ wrk ่ฟ่กๅๅๆต่ฏๆฌ้กน็ฎไธ frp ่ฟ่กๅฏนๆฏ๏ผๅ ็ฝๆๅกๆๅๅจๆฌๅฐ่ฟ่ก nginx ็ๆต่ฏ้กต้ข๏ผๆต่ฏ็ปๆๅฆไธ๏ผ
Model Name: MacBook Pro
Model Identifier: MacBookPro17,1
Chip: Apple M1
Total Number of Cores: 8 (4 performance and 4 efficiency)
Memory: 16 GB
$ wrk -c 100 -d 30s -t 10 http://pi.example.com:7001
Running 30s test @ http://pi.example.com:7001
10 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 2.22ms 710.73us 37.99ms 98.30%
Req/Sec 4.60k 231.54 4.86k 91.47%
1374783 requests in 30.01s, 1.09GB read
Requests/sec: 45811.08
Transfer/sec: 37.14MB
$ ps aux
PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
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
2767 0.0 0.1 408703664 17584 s007 S+ 4:55PM 0:52.16 ./server -port 7001
$ wrk -c 100 -d 30s -t 10 http://pi.example.com:7000
Running 30s test @ http://pi.example.com:7000
10 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 76.92ms 73.46ms 748.61ms 74.21%
Req/Sec 154.63 308.28 2.02k 93.75%
45487 requests in 30.10s, 31.65MB read
Non-2xx or 3xx responses: 20610
Requests/sec: 1511.10
Transfer/sec: 1.05MB
$ ps aux
PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
2975 0.3 0.5 408767328 88768 s004 S+ 5:01PM 0:21.88 ./frps -c ./frps.ini
2976 0.0 0.4 408712832 66112 s005 S+ 5:01PM 1:06.51 ./frpc -c ./frpc.ini
้่ฟ wrk ่ฟ่กๅๅๆต่ฏๆฌ้กน็ฎไธ frp ่ฟ่กๅฏนๆฏ๏ผๅ ็ฝๆๅกๆๅๅจๆฌๅฐ่ฟ่ก nginx ็ๆต่ฏ้กต้ข๏ผๆต่ฏ็ปๆๅฆไธ๏ผ
System: Ubuntu 22.04
Chip: Intel i9-12900
Total Number of Cores: 16 (8 performance and 8 efficiency)
Memory: 32 GB
$ ./release/linux-amd64-server -addr 12080 -id id1 -secret secret1
$ ./release/linux-amd64-client -local http://127.0.0.1:80 -remote tcp://id1.example.com:12080 -id id1 -secret secret1
$ wrk -c 100 -d 30s -t 10 http://id1.example.com:12080
Running 30s test @ http://id1.example.com:12080
10 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 558.51us 2.05ms 71.54ms 99.03%
Req/Sec 24.29k 2.28k 49.07k 95.74%
7264421 requests in 30.10s, 5.81GB read
Requests/sec: 241344.46
Transfer/sec: 197.70MB
$ ./release/linux-amd64-server -addr 12080 -quicAddr 443 -certFile /root/openssl_crt/tls.crt -keyFile /root/openssl_crt/tls.key -id id1 -secret secret1
$ ./release/linux-amd64-client -local http://127.0.0.1:80 -remote quic://id1.example.com:443 -remoteCertInsecure -id id1 -secret secret1
$ wrk -c 100 -d 30s -t 10 http://id1.example.com:12080
Running 30s test @ http://id1.example.com:12080
10 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 826.65us 1.14ms 66.29ms 98.68%
Req/Sec 12.91k 1.36k 23.53k 79.43%
3864241 requests in 30.10s, 3.09GB read
Requests/sec: 128380.49
Transfer/sec: 105.16MB
$ ./frps -c ./frps.toml
$ ./frpc -c ./frpc.toml
$ wrk -c 100 -d 30s -t 10 http://id1.example.com:12080/
Running 30s test @ http://id1.example.com:12080/
10 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 4.49ms 8.27ms 154.62ms 92.43%
Req/Sec 4.02k 2.08k 7.51k 53.21%
1203236 requests in 30.08s, 0.93GB read
Requests/sec: 40003.03
Transfer/sec: 31.82MB
้่ฟ wrk ่ฟ่กๅๅๆต่ฏๆฌ้กน็ฎไธ frp ่ฟ่กๅฏนๆฏ๏ผๆฏๆฌก่ฏทๆฑๅชไผ่ฟๅๅฐไบ10ๅญ่็ๅญๆฎตๅๅค๏ผ็จไบๆจกๆHTTP short request๏ผๆต่ฏ็ปๆๅฆไธ๏ผ
$ ./release/linux-amd64-server -addr 12080 -id id1 -secret secret1
$ ./release/linux-amd64-client -local http://127.0.0.1:80 -remote tcp://id1.example.com:12080 -id id1 -secret secret1
$ wrk -c 100 -d 30s -t 10 http://id1.example.com:12080/
Running 30s test @ http://id1.example.com:12080/
10 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 4.55ms 13.48ms 220.23ms 95.31%
Req/Sec 5.23k 2.11k 12.40k 76.10%
1557980 requests in 30.06s, 191.67MB read
Requests/sec: 51822.69
Transfer/sec: 6.38MB
$ ./release/linux-amd64-server -addr 12080 -quicAddr 443 -certFile /root/openssl_crt/tls.crt -keyFile /root/openssl_crt/tls.key -id id1 -secret secret1
$ ./release/linux-amd64-client -local http://127.0.0.1:80 -remote quic://id1.example.com:443 -remoteCertInsecure -id id1 -secret secret1
$ wrk -c 100 -d 30s -t 10 http://id1.example.com:12080/
Running 30s test @ http://id1.example.com:12080/
10 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.84ms 6.75ms 168.93ms 98.47%
Req/Sec 9.33k 2.13k 22.86k 78.54%
2787908 requests in 30.10s, 342.98MB read
Requests/sec: 92622.63
Transfer/sec: 11.39MB
$ ./frps -c ./frps.toml
$ ./frpc -c ./frpc.toml
$ wrk -c 100 -d 30s -t 10 http://id1.example.com:12080/
Running 30s test @ http://id1.example.com:12080/
10 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 2.95ms 3.74ms 136.09ms 91.10%
Req/Sec 4.16k 1.22k 12.86k 87.85%
1243103 requests in 30.07s, 152.93MB read
Requests/sec: 41334.52
Transfer/sec: 5.09MB
ๆฌข่ฟๅ ๅ ฅ Slack ้ข้่ฟ่กไบคๆตใ
ๅพฎไฟก็พค๏ผ
ๅฏๆซๆไธๆนไบ็ปด็ ๏ผ้่ฏทไฝ ๅ ๅ ฅ GT ็คพๅบไบคๆต็พค๏ผ่ฏทๅคๆณจ GT
ๆ่ฐขไปฅไธๅผๅ่ ไธบ้กน็ฎๅๅบ็่ดก็ฎ๏ผ