Skip to content

Commit cee6376

Browse files
refactor(config): update transport settings in client and server JSON files
- Changed transport type from "xhttp" to "http" in vless-xhttp client and server configurations. - Updated WireGuard client and server configurations to use "endpoints" instead of "inbounds" and "outbounds" for better clarity and structure. - Adjusted tags for WireGuard endpoints to maintain consistency across configurations. This refactor improves the clarity and maintainability of the configuration files.
1 parent 9071668 commit cee6376

13 files changed

Lines changed: 45 additions & 34 deletions

File tree

cmd/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ func runOne(ctx context.Context, dir string, db *store.DB) error {
115115
}
116116
fmt.Printf(" [%s] %s duration=%s censor=%s\n",
117117
label, status, res.Duration.Round(time.Millisecond), res.Fingerprint.Verdict)
118+
if res.Err != nil {
119+
fmt.Printf(" error: %v\n", res.Err)
120+
}
118121
}
119122
if anyFail {
120123
return fmt.Errorf("test failed")

examples/sing-box/vless-xhttp/client.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@
2424
"certificate_path": "{{TLS_CA}}"
2525
},
2626
"transport": {
27-
"type": "xhttp",
28-
"mode": "stream-up",
27+
"type": "http",
2928
"host": "{{HOST_NAME}}",
30-
"path": "/xhttp",
31-
"domain_strategy": "prefer_ipv4"
29+
"path": "/xhttp"
3230
}
3331
},
3432
{"type": "direct", "tag": "direct"}

examples/sing-box/vless-xhttp/server.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
"key_path": "{{TLS_KEY}}"
1717
},
1818
"transport": {
19-
"type": "xhttp",
20-
"mode": "stream-up",
19+
"type": "http",
2120
"path": "/xhttp"
2221
}
2322
}

examples/sing-box/wireguard/client.json

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,30 @@
1414
}
1515
],
1616

17-
"outbounds": [
17+
"endpoints": [
1818
{
1919
"type": "wireguard",
20-
"tag": "wg-out",
21-
"server": "{{ SERVER }}",
22-
"server_port": {{ PORT }},
20+
"tag": "wg-ep",
2321
"private_key": "{{ WG_CLIENT_PRIVKEY }}",
24-
"peer_public_key": "{{ WG_SERVER_PUBKEY }}",
25-
"address": ["10.0.0.2/24"],
26-
"mtu": 1420,
27-
},
22+
"peers": [
23+
{
24+
"address": "{{ SERVER }}",
25+
"port": {{ PORT }},
26+
"public_key": "{{ WG_SERVER_PUBKEY }}",
27+
"allowed_ips": ["0.0.0.0/0", "::/0"],
28+
}
29+
],
30+
"address": ["10.0.0.2/24"],
31+
"mtu": 1420,
32+
}
33+
],
34+
35+
"outbounds": [
2836
{"type": "direct", "tag": "direct"},
2937
],
3038

3139
"route": {
32-
"final": "wg-out",
40+
"final": "wg-ep",
3341
"default_domain_resolver": "default",
3442
"auto_detect_interface": true,
3543
},

examples/sing-box/wireguard/run.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
"vars": [
1313
{
1414
"TITLE": "wg-test",
15-
// WireGuard key pairs — set via env or here directly:
16-
// "WG_SERVER_PRIVKEY": "<base64 server private key>",
17-
// "WG_SERVER_PUBKEY": "<base64 server public key>",
18-
// "WG_CLIENT_PRIVKEY": "<base64 client private key>",
19-
// "WG_CLIENT_PUBKEY": "<base64 client public key>",
15+
"WG_SERVER_PRIVKEY": "uPiS0+/WJcomlFcVQuG6/eRWA0Bg7GBoq+EAeL5V23Y=",
16+
"WG_SERVER_PUBKEY": "t7y88aH9kzASz0t5u7lhHDkSstkL46fZCCSE/6yAEEg=",
17+
"WG_CLIENT_PRIVKEY": "gLaFefR+ujDAsahKXiAPJkAddoKutwwZRZ3/7mWsH0g=",
18+
"WG_CLIENT_PUBKEY": "C8k8tl2QODvzkJNdQ9Ld6u+fCi+lTIE3e0uRyo/8Xkk=",
2019
},
2120
],
2221

examples/sing-box/wireguard/server.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22
// sing-box WireGuard server config
33
"log": {"level": "error"},
44

5-
"inbounds": [
5+
"endpoints": [
66
{
77
"type": "wireguard",
8-
"tag": "wg-in",
9-
"listen": "{{ SERVER }}",
8+
"tag": "wg-ep",
109
"listen_port": {{ PORT }},
1110
"private_key": "{{ WG_SERVER_PRIVKEY }}",
1211
"peers": [
1312
{
14-
"public_key": "{{ WG_CLIENT_PUBKEY }}",
15-
"allowed_ips": ["0.0.0.0/0", "::/0"],
13+
"public_key": "{{ WG_CLIENT_PUBKEY }}",
14+
"allowed_ips": ["10.0.0.2/32"],
1615
}
1716
],
1817
"address": ["10.0.0.1/24"],

examples/xray/templates/tls/client.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{% if TLS %}
2+
"security": "tls",
23
"tlsSettings": {
34
"serverName": "{{SNI_NAME}}",
5+
"alpn": ["h2", "http/1.1"],
46
"allowInsecure": false,
57
"certificates": [
68
{

examples/xray/templates/tls/server.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{% if TLS %}
22
"security": "tls",
33
"tlsSettings": {
4+
"alpn": ["h2", "http/1.1"],
45
"certificates": [
56
{
67
"certificateFile": "{{TLS_CERT}}",

examples/xray/vless-xhttp/client.json.j2

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,25 @@
22

33
{% block outbound %}
44
{
5-
"tag": "vless-out",
5+
"tag": "proxy",
66
"protocol": "vless",
77
"settings": {
88
"vnext": [
99
{
1010
"address": "{{ SERVER }}",
1111
"port": {{ PORT }},
12-
"users": [{"id": "{{ UUID }}", "encryption": "none"}]
12+
"users": [{"id": "{{ UUID }}", "encryption": "{{ VLESS_ENC }}", "flow": "{{ VLESS_FLOW }}"}]
1313
}
1414
]
1515
},
1616
"streamSettings": {
1717
"network": "xhttp",
1818
{% include "../templates/tls/client.tpl" %}
1919
"xhttpSettings": {
20-
"mode": "stream-up",
20+
"mode": "auto",
2121
"host": "{{ HOST_NAME }}",
2222
"path": "/xhttp"
2323
}
2424
}
25-
},
26-
{"protocol": "freedom", "tag": "direct"}
25+
}
2726
{% endblock %}

examples/xray/vless-xhttp/run.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "VLESS + xHTTP (xray)",
55
"server_config": "server.json", // .j2 extension resolved automatically
66
"client_config": "client.json",
7-
"tls": false, // TLS injected per-variant below via TLS var
7+
"tls": true,
88

99
"vars": [
1010
{

0 commit comments

Comments
 (0)