Compare commits
No commits in common. "3bbbfa69ad7998f1f5317967b28e014f3224aacb" and "b743d47f09c20aa82ae90507600610d4fc19bd3b" have entirely different histories.
3bbbfa69ad
...
b743d47f09
3 changed files with 30 additions and 84 deletions
77
README.md
77
README.md
|
@ -18,6 +18,36 @@ SB supports many protocols and platforms, even can setup a TUN interface (like a
|
||||||
On the other hand, Xray provides more "stealth" features to hide proxy traffic,
|
On the other hand, Xray provides more "stealth" features to hide proxy traffic,
|
||||||
that is important, I guess (?), in China and Iran.
|
that is important, I guess (?), in China and Iran.
|
||||||
|
|
||||||
|
## To reproduce
|
||||||
|
|
||||||
|
- Get [sing-box](https://github.com/SagerNet/sing-box/releases/latest)
|
||||||
|
and [xray](github.com/XTLS/Xray-core/releases/latest) binaries
|
||||||
|
by downloading from "Releases" or compiling by yourself
|
||||||
|
- Compile [iperf3 fork with socks5 support](https://github.com/davidBar-On/iperf/tree/issue-1095-socks5-support)
|
||||||
|
by cloning git repo (don't forget that you need branch `issue-1095-socks5-support`, not master!)
|
||||||
|
and running `./configure && make` -- you'll get a built iperf in `./src/iperf3`
|
||||||
|
- Generate your own TLS cert (`cert.pem` and `key.pem` included in the repo are for `dc09.ru` domain name)
|
||||||
|
with `sing-box generate tls-keypair <insert domain here>` OR `xray tls cert --domain=<domain>`
|
||||||
|
- Replace `dc09.ru` in all configs to match your domain name instead of mine
|
||||||
|
- Upload sing-box and xray to your server, install iperf3 from a package manager
|
||||||
|
or upload compiled previously (on a server, you won't need socks support),
|
||||||
|
upload `server.json`, `server_xray.json`, `cert.pem` and `key.pem`
|
||||||
|
- Run `./sing-box run --config server.json &` on your server, then launch `iperf3 -s`
|
||||||
|
- In `config.json` edit the line `"final": "vless-out"` to default to `socks-out`,
|
||||||
|
the same for `config_xray.json`: edit `"outboundTag": "vless-out"` in the 2nd routing rule.
|
||||||
|
- Run `./sing-box run --config config.json` and `./xray run -c config_xray.json` on client,
|
||||||
|
sing-box will open port 2080 for a SOCKSv5 inbound, xray will open port 2081 for its inbound.
|
||||||
|
- Make tests with iperf3:
|
||||||
|
`repo_with_iperf_fork/src/iperf3 -c <address of your server or domain> --bidir --socks5 127.0.0.1:2080`
|
||||||
|
for sing-box client and `... --socks5 127.0.0.1:2081` for xray client.
|
||||||
|
- Change `"final": "socks-out"` and `"outboundTag": "socks-out"` to `trojan-out` to test with Trojan,
|
||||||
|
restart sing-box and xray on client, peform iperf3 tests,
|
||||||
|
then change default outbound back to `vless-out`, restart proxy clients again, peform tests
|
||||||
|
- Stop iperf3 server by hitting Ctrl-C, stop sing-box server proxy by bringing the task to foreground with `fg` command and hitting Ctrl-C
|
||||||
|
- Run `./xray run -c server_xray.json &` on the server, then launch `iperf3 -s`
|
||||||
|
- Repeat the tests
|
||||||
|
- Stop iperf3 with Ctrl-C, stop xray with `fg` and Ctrl-C
|
||||||
|
|
||||||
## Software versions used
|
## Software versions used
|
||||||
|
|
||||||
sing-box built from dev-next branch, [26f092d](https://github.com/SagerNet/sing-box/commit/26f092da6fb0801b11c91fd5c8468e9949312e02)
|
sing-box built from dev-next branch, [26f092d](https://github.com/SagerNet/sing-box/commit/26f092da6fb0801b11c91fd5c8468e9949312e02)
|
||||||
|
@ -126,50 +156,3 @@ File: `bench_xray_*.txt`
|
||||||
|SOCKSv5|101.5 (91.3)|103.0 (91.4)|
|
|SOCKSv5|101.5 (91.3)|103.0 (91.4)|
|
||||||
|Trojan|100.1 (90.0)|100.5 (90.6)|
|
|Trojan|100.1 (90.0)|100.5 (90.6)|
|
||||||
|VLESS|99.6 (91.1)|102.0 (91.1)|
|
|VLESS|99.6 (91.1)|102.0 (91.1)|
|
||||||
|
|
||||||
## To reproduce
|
|
||||||
|
|
||||||
- Get [sing-box](https://github.com/SagerNet/sing-box/releases/latest)
|
|
||||||
and [xray](github.com/XTLS/Xray-core/releases/latest) binaries
|
|
||||||
by downloading from "Releases" or compiling by yourself
|
|
||||||
|
|
||||||
Benchmark 1:
|
|
||||||
- Install [hyperfine](https://github.com/sharkdp/hyperfine)
|
|
||||||
- Run `./sing-box run --config direct.json` and `./xray run -c direct_xray.json` on client
|
|
||||||
(use different terminal tabs/windows, or put one proxy to background with `&`)
|
|
||||||
- Find some binary file with size about 1.5M and upload it to your server
|
|
||||||
(because I can not guarantee that I won't delete `Marisa.m4a` used in tests;
|
|
||||||
it's an audio stream of some video downloaded from YT)
|
|
||||||
- Run
|
|
||||||
`hyperfine -m 50 'curl https://...link to the file...' 'curl --proxy socks5://127.0.0.1:2080 https://link' 'curl --proxy socks5://127.0.0.1:2081 https://link'`
|
|
||||||
- Choose some web site with a small load and no ratelimits that gives an https-redirect
|
|
||||||
with a small HTML response when accessing it by plain http, like `http://dc09.ru`,
|
|
||||||
repeat the test replacing the link
|
|
||||||
- Choose some web site with a heavy load and relatively small HTML landing, like `https://github.com`,
|
|
||||||
repeat the test replacing the link
|
|
||||||
|
|
||||||
Benchmark 2:
|
|
||||||
- Compile [iperf3 fork with socks5 support](https://github.com/davidBar-On/iperf/tree/issue-1095-socks5-support)
|
|
||||||
by cloning git repo (don't forget that you need branch `issue-1095-socks5-support`, not master!)
|
|
||||||
and running `./configure && make` -- you'll get a built iperf in `./src/iperf3`
|
|
||||||
- Generate your own TLS cert (`cert.pem` and `key.pem` included in the repo are for `dc09.ru` domain name)
|
|
||||||
with `sing-box generate tls-keypair <insert domain here>` OR `xray tls cert --domain=<domain>`
|
|
||||||
- Replace `dc09.ru` in all configs to match your domain name instead of mine
|
|
||||||
- Upload sing-box and xray to your server, install iperf3 from a package manager
|
|
||||||
or upload compiled previously (on a server, you won't need socks support),
|
|
||||||
upload `server.json`, `server_xray.json`, `cert.pem` and `key.pem`
|
|
||||||
- Run `./sing-box run --config server.json &` on your server, then launch `iperf3 -s`
|
|
||||||
- In `config.json` edit the line `"final": "vless-out"` to default to `socks-out`,
|
|
||||||
the same for `config_xray.json`: edit `"outboundTag": "vless-out"` in the 2nd routing rule.
|
|
||||||
- Run `./sing-box run --config config.json` and `./xray run -c config_xray.json` on client,
|
|
||||||
sing-box will open port 2080 for a SOCKSv5 inbound, xray will open port 2081 for its inbound.
|
|
||||||
- Make tests with iperf3:
|
|
||||||
`repo_with_iperf_fork/src/iperf3 -c <address of your server or domain> --bidir --socks5 127.0.0.1:2080`
|
|
||||||
for sing-box client and `... --socks5 127.0.0.1:2081` for xray client.
|
|
||||||
- Change `"final": "socks-out"` and `"outboundTag": "socks-out"` to `trojan-out` to test with Trojan,
|
|
||||||
restart sing-box and xray on client, peform iperf3 tests,
|
|
||||||
then change default outbound back to `vless-out`, restart proxy clients again, peform tests
|
|
||||||
- Stop iperf3 server by hitting Ctrl-C, stop sing-box server proxy by bringing the task to foreground with `fg` command and hitting Ctrl-C
|
|
||||||
- Run `./xray run -c server_xray.json &` on the server, then launch `iperf3 -s`
|
|
||||||
- Repeat the tests
|
|
||||||
- Stop iperf3 with Ctrl-C, stop xray with `fg` and Ctrl-C
|
|
||||||
|
|
17
direct.json
17
direct.json
|
@ -1,17 +0,0 @@
|
||||||
{
|
|
||||||
"log": {
|
|
||||||
"disabled": true
|
|
||||||
},
|
|
||||||
"inbounds": [
|
|
||||||
{
|
|
||||||
"type": "socks",
|
|
||||||
"listen": "127.0.0.1",
|
|
||||||
"listen_port": 2080
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"outbounds": [
|
|
||||||
{
|
|
||||||
"type": "direct"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
"log": {
|
|
||||||
"loglevel": "none"
|
|
||||||
},
|
|
||||||
"inbounds": [
|
|
||||||
{
|
|
||||||
"protocol": "socks",
|
|
||||||
"listen": "127.0.0.1",
|
|
||||||
"port": 2081,
|
|
||||||
"settings": {
|
|
||||||
"udp": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"outbounds": [
|
|
||||||
{
|
|
||||||
"protocol": "freedom"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue