update
This commit is contained in:
@@ -168,8 +168,8 @@ func (d *Deps) HandlePreviewSource(c fiber.Ctx) error {
|
||||
applyFiltersSafe(original, rec.Filters, settings, "json", rec.ID),
|
||||
)
|
||||
return success(c, fiber.Map{
|
||||
"original": proxy.AddPreviewIds(original),
|
||||
"processed": proxy.AddPreviewIds(processed),
|
||||
"original": d.addCachedEgressInfo(proxy.AddPreviewIds(original)),
|
||||
"processed": d.addCachedEgressInfo(proxy.AddPreviewIds(processed)),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ func (d *Deps) HandlePreviewSource(c fiber.Ctx) error {
|
||||
"body": result.Body,
|
||||
"nodes": result.Nodes,
|
||||
"originalCount": result.OriginalNodes,
|
||||
"processed": previewNodesFromBody(result.Body),
|
||||
"processed": d.addCachedEgressInfo(previewNodesFromBody(result.Body)),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ func (d *Deps) HandlePreviewCollection(c fiber.Ctx) error {
|
||||
"body": result.Body,
|
||||
"nodes": result.Nodes,
|
||||
"originalCount": result.OriginalNodes,
|
||||
"processed": previewNodesFromBody(result.Body),
|
||||
"processed": d.addCachedEgressInfo(previewNodesFromBody(result.Body)),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,257 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/sha256"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
|
||||
"github.com/peterqiu0516/sub-store/internal/model"
|
||||
"github.com/peterqiu0516/sub-store/internal/render"
|
||||
"github.com/peterqiu0516/sub-store/internal/util"
|
||||
)
|
||||
|
||||
func (d *Deps) HandleEgressInfo(c fiber.Ctx) error {
|
||||
var node model.ProxyNode
|
||||
if err := json.Unmarshal(c.Body(), &node); err != nil {
|
||||
return failed(c, "Invalid JSON", 400)
|
||||
}
|
||||
if getStringValue(node["server"]) == "" {
|
||||
node["server"] = getStringValue(node["address"])
|
||||
}
|
||||
if getStringValue(node["name"]) == "" {
|
||||
node["name"] = "PROXY"
|
||||
}
|
||||
|
||||
cacheKey := egressCacheKey(node)
|
||||
if entry, ok := d.CacheRepo.SafeGet(cacheKey); ok {
|
||||
var cached map[string]any
|
||||
if json.Unmarshal([]byte(entry.Content), &cached) == nil {
|
||||
cached["cached"] = true
|
||||
return success(c, cached)
|
||||
}
|
||||
}
|
||||
|
||||
latencyMs, latencyErr := probeServerPortLatency(node, 5*time.Second)
|
||||
port, err := freeLocalPort()
|
||||
if err != nil {
|
||||
return failed(c, err.Error(), 500)
|
||||
}
|
||||
configData, err := buildEgressProbeConfig(node, port)
|
||||
if err != nil {
|
||||
return failed(c, err.Error(), 400)
|
||||
}
|
||||
|
||||
info, err := runEgressProbe(configData, port)
|
||||
if err != nil {
|
||||
info = fiber.Map{"egressError": err.Error()}
|
||||
}
|
||||
if latencyMs >= 0 {
|
||||
info["latencyMs"] = latencyMs
|
||||
}
|
||||
if latencyErr != "" {
|
||||
info["latencyError"] = latencyErr
|
||||
}
|
||||
info["cached"] = false
|
||||
if data, err := json.Marshal(info); err == nil {
|
||||
ttl := int(d.Cfg.Fetcher.CacheTTL.Seconds())
|
||||
if ttl <= 0 {
|
||||
ttl = 300
|
||||
}
|
||||
d.CacheRepo.SafePut(cacheKey, string(data), nil, ttl)
|
||||
}
|
||||
return success(c, info)
|
||||
}
|
||||
|
||||
func egressCacheKey(node model.ProxyNode) string {
|
||||
clean := model.ProxyNode{}
|
||||
skip := map[string]bool{
|
||||
"id": true, "latencyMs": true, "latencyError": true,
|
||||
"egressIp": true, "egressCountry": true, "egressRegion": true, "egressError": true,
|
||||
"country": true, "region": true, "city": true, "isp": true, "cached": true,
|
||||
}
|
||||
for k, v := range node {
|
||||
if !skip[k] {
|
||||
clean[k] = v
|
||||
}
|
||||
}
|
||||
data, _ := json.Marshal(clean)
|
||||
sum := sha256.Sum256(data)
|
||||
return fmt.Sprintf("egress:%x", sum)
|
||||
}
|
||||
|
||||
func (d *Deps) addCachedEgressInfo(nodes []model.ProxyNode) []model.ProxyNode {
|
||||
for _, node := range nodes {
|
||||
entry, ok := d.CacheRepo.SafeGet(egressCacheKey(node))
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
var cached map[string]any
|
||||
if json.Unmarshal([]byte(entry.Content), &cached) != nil {
|
||||
continue
|
||||
}
|
||||
for _, key := range []string{"egressIp", "country", "region", "city", "isp", "latencyMs", "latencyError", "egressError"} {
|
||||
if v, ok := cached[key]; ok {
|
||||
node[key] = v
|
||||
}
|
||||
}
|
||||
node["cached"] = true
|
||||
}
|
||||
return nodes
|
||||
}
|
||||
|
||||
func probeServerPortLatency(node model.ProxyNode, timeout time.Duration) (int64, string) {
|
||||
server := getStringValue(node["server"])
|
||||
port := toIntSafe(node["port"])
|
||||
if server == "" || port <= 0 {
|
||||
return -1, "missing server or port"
|
||||
}
|
||||
start := time.Now()
|
||||
conn, err := net.DialTimeout("tcp", net.JoinHostPort(server, fmt.Sprint(port)), timeout)
|
||||
if err != nil {
|
||||
return -1, err.Error()
|
||||
}
|
||||
_ = conn.Close()
|
||||
return time.Since(start).Milliseconds(), ""
|
||||
}
|
||||
|
||||
func buildEgressProbeConfig(node model.ProxyNode, port int) ([]byte, error) {
|
||||
probeNode := model.ProxyNode{}
|
||||
for k, v := range node {
|
||||
probeNode[k] = v
|
||||
}
|
||||
probeNode["name"] = "PROXY"
|
||||
|
||||
outbound := render.ToSingBoxOutbound(probeNode)
|
||||
if outbound == nil {
|
||||
return nil, fmt.Errorf("Unsupported proxy node for egress probe")
|
||||
}
|
||||
doc := map[string]any{
|
||||
"log": map[string]any{"level": "warn"},
|
||||
"inbounds": []any{
|
||||
map[string]any{
|
||||
"type": "mixed",
|
||||
"tag": "mixed-in",
|
||||
"listen": "127.0.0.1",
|
||||
"listen_port": port,
|
||||
},
|
||||
},
|
||||
"outbounds": []any{
|
||||
outbound,
|
||||
map[string]any{"type": "direct", "tag": "DIRECT"},
|
||||
},
|
||||
"route": map[string]any{
|
||||
"auto_detect_interface": true,
|
||||
"final": "PROXY",
|
||||
"rules": []any{map[string]any{"action": "sniff"}},
|
||||
},
|
||||
}
|
||||
return json.Marshal(doc)
|
||||
}
|
||||
|
||||
func runEgressProbe(configData []byte, port int) (fiber.Map, error) {
|
||||
singBox, err := exec.LookPath("sing-box")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("sing-box executable not found")
|
||||
}
|
||||
dir, err := os.MkdirTemp("", "sub-store-egress-*")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer os.RemoveAll(dir)
|
||||
|
||||
configPath := filepath.Join(dir, "config.json")
|
||||
if err := os.WriteFile(configPath, configData, 0o600); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 25*time.Second)
|
||||
defer cancel()
|
||||
cmd := exec.CommandContext(ctx, singBox, "run", "-c", configPath)
|
||||
var stderr bytes.Buffer
|
||||
cmd.Stderr = &stderr
|
||||
if err := cmd.Start(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer func() {
|
||||
cancel()
|
||||
_ = cmd.Wait()
|
||||
}()
|
||||
|
||||
if err := waitTCP("127.0.0.1", port, 5*time.Second); err != nil {
|
||||
msg := strings.TrimSpace(stderr.String())
|
||||
if msg != "" {
|
||||
return nil, fmt.Errorf("%s", msg)
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
proxyURL, _ := url.Parse(fmt.Sprintf("http://127.0.0.1:%d", port))
|
||||
client := &http.Client{
|
||||
Timeout: 15 * time.Second,
|
||||
Transport: &http.Transport{
|
||||
Proxy: http.ProxyURL(proxyURL),
|
||||
},
|
||||
}
|
||||
resp, err := client.Get("https://ipwho.is/?lang=en")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
body, _ := io.ReadAll(io.LimitReader(resp.Body, util.MaxFlowRespBytes))
|
||||
|
||||
var data map[string]any
|
||||
if err := json.Unmarshal(body, &data); err != nil {
|
||||
return nil, fmt.Errorf("Invalid egress info response")
|
||||
}
|
||||
if success, ok := data["success"].(bool); ok && !success {
|
||||
msg := getStringValue(data["message"])
|
||||
if msg == "" {
|
||||
msg = "Egress info lookup failed"
|
||||
}
|
||||
return nil, fmt.Errorf("%s", msg)
|
||||
}
|
||||
connection, _ := data["connection"].(map[string]any)
|
||||
return fiber.Map{
|
||||
"egressIp": data["ip"],
|
||||
"country": data["country"],
|
||||
"region": data["region"],
|
||||
"city": data["city"],
|
||||
"isp": connection["isp"],
|
||||
}, nil
|
||||
}
|
||||
|
||||
func freeLocalPort() (int, error) {
|
||||
l, err := net.Listen("tcp", "127.0.0.1:0")
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
defer l.Close()
|
||||
return l.Addr().(*net.TCPAddr).Port, nil
|
||||
}
|
||||
|
||||
func waitTCP(host string, port int, timeout time.Duration) error {
|
||||
deadline := time.Now().Add(timeout)
|
||||
addr := fmt.Sprintf("%s:%d", host, port)
|
||||
for time.Now().Before(deadline) {
|
||||
conn, err := net.DialTimeout("tcp", addr, 200*time.Millisecond)
|
||||
if err == nil {
|
||||
conn.Close()
|
||||
return nil
|
||||
}
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
}
|
||||
return fmt.Errorf("Timed out waiting for sing-box")
|
||||
}
|
||||
@@ -4,11 +4,13 @@ import (
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
"github.com/jmoiron/sqlx"
|
||||
@@ -105,6 +107,7 @@ func registerHandlers(app *fiber.App, deps *Deps) {
|
||||
app.Post("/api/rule/parse", deps.HandleRuleParse)
|
||||
app.Post("/api/utils/proxy-uri", deps.HandleProxyURI)
|
||||
app.Post("/api/utils/node-info", deps.HandleNodeInfo)
|
||||
app.Post("/api/utils/egress-info", deps.HandleEgressInfo)
|
||||
|
||||
app.Get("/sources/:name/:token", deps.HandleDownloadSource)
|
||||
app.Get("/collections/:name/:token", deps.HandleDownloadCollection)
|
||||
@@ -2065,6 +2068,78 @@ func TestHandleNodeInfoServerWithBrackets(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildEgressProbeConfig(t *testing.T) {
|
||||
data, err := buildEgressProbeConfig(model.ProxyNode{
|
||||
"type": "ss",
|
||||
"name": "demo",
|
||||
"server": "127.0.0.1",
|
||||
"port": 8388,
|
||||
"cipher": "aes-256-gcm",
|
||||
"password": "pass",
|
||||
}, 19090)
|
||||
if err != nil {
|
||||
t.Fatalf("buildEgressProbeConfig returned error: %v", err)
|
||||
}
|
||||
var doc map[string]any
|
||||
if err := json.Unmarshal(data, &doc); err != nil {
|
||||
t.Fatalf("invalid config JSON: %v", err)
|
||||
}
|
||||
route := doc["route"].(map[string]any)
|
||||
if route["final"] != "PROXY" {
|
||||
t.Fatalf("route.final = %v, want PROXY", route["final"])
|
||||
}
|
||||
inbound := doc["inbounds"].([]any)[0].(map[string]any)
|
||||
if inbound["listen"] != "127.0.0.1" || inbound["listen_port"].(float64) != 19090 {
|
||||
t.Fatalf("unexpected inbound: %v", inbound)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandleEgressInfoUnsupported(t *testing.T) {
|
||||
deps := newTestDeps(t)
|
||||
app := newApp(deps)
|
||||
code, _ := doRequest(t, app, "POST", "/api/utils/egress-info", `{"type":"unknown","server":"1.2.3.4","port":443}`, nil)
|
||||
assertStatus(t, "EgressInfo unsupported", code, 400)
|
||||
}
|
||||
|
||||
func TestProbeServerPortLatency(t *testing.T) {
|
||||
ln, err := net.Listen("tcp", "127.0.0.1:0")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer ln.Close()
|
||||
go func() {
|
||||
conn, err := ln.Accept()
|
||||
if err == nil {
|
||||
conn.Close()
|
||||
}
|
||||
}()
|
||||
latency, msg := probeServerPortLatency(model.ProxyNode{
|
||||
"server": "127.0.0.1",
|
||||
"port": ln.Addr().(*net.TCPAddr).Port,
|
||||
}, time.Second)
|
||||
if msg != "" {
|
||||
t.Fatalf("unexpected latency error: %s", msg)
|
||||
}
|
||||
if latency < 0 {
|
||||
t.Fatalf("latency = %d, want >= 0", latency)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAddCachedEgressInfo(t *testing.T) {
|
||||
deps := newTestDeps(t)
|
||||
node := model.ProxyNode{
|
||||
"type": "ss",
|
||||
"name": "n",
|
||||
"server": "127.0.0.1",
|
||||
"port": 8388,
|
||||
}
|
||||
deps.CacheRepo.SafePut(egressCacheKey(node), `{"egressIp":"1.1.1.1","country":"Japan","region":"Tokyo","latencyMs":12}`, nil, 300)
|
||||
nodes := deps.addCachedEgressInfo([]model.ProxyNode{node})
|
||||
if nodes[0]["egressIp"] != "1.1.1.1" || nodes[0]["latencyMs"].(float64) != 12 {
|
||||
t.Fatalf("cached egress not merged: %v", nodes[0])
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// RegisterRoutes integration (uses real middleware)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -98,6 +98,7 @@ func RegisterRoutes(app *fiber.App, cfg *config.Config, db *sqlx.DB) {
|
||||
api.Post("/rule/parse", deps.HandleRuleParse)
|
||||
api.Post("/utils/proxy-uri", deps.HandleProxyURI)
|
||||
api.Post("/utils/node-info", deps.HandleNodeInfo)
|
||||
api.Post("/utils/egress-info", deps.HandleEgressInfo)
|
||||
|
||||
// Public download routes — no admin token required, uses download token
|
||||
app.Get("/sources/:name/:token", deps.HandleDownloadSource)
|
||||
|
||||
@@ -96,6 +96,13 @@ func TestParseVMess(t *testing.T) {
|
||||
if n["network"] != "ws" {
|
||||
t.Errorf("expected network ws, got %v", n["network"])
|
||||
}
|
||||
ws, ok := n["ws-opts"].(map[string]any)
|
||||
if !ok {
|
||||
t.Fatalf("expected ws-opts map, got %T", n["ws-opts"])
|
||||
}
|
||||
if ws["path"] != "/path" {
|
||||
t.Errorf("expected ws path /path, got %v", ws["path"])
|
||||
}
|
||||
if n["tls"] != true {
|
||||
t.Errorf("expected tls true, got %v", n["tls"])
|
||||
}
|
||||
@@ -117,6 +124,13 @@ func TestParseVLESS(t *testing.T) {
|
||||
if n["network"] != "ws" {
|
||||
t.Errorf("expected network ws, got %v", n["network"])
|
||||
}
|
||||
ws, ok := n["ws-opts"].(map[string]any)
|
||||
if !ok {
|
||||
t.Fatalf("expected ws-opts map, got %T", n["ws-opts"])
|
||||
}
|
||||
if ws["path"] != "/path" {
|
||||
t.Errorf("expected ws path /path, got %v", ws["path"])
|
||||
}
|
||||
if n["tls"] != true {
|
||||
t.Errorf("expected tls true, got %v", n["tls"])
|
||||
}
|
||||
|
||||
@@ -142,19 +142,29 @@ func ParseVless(line string, index int) model.ProxyNode {
|
||||
}
|
||||
|
||||
node := map[string]any{
|
||||
"name": fragmentName(u, fmt.Sprintf("vless-%d", index+1)),
|
||||
"type": "vless",
|
||||
"server": u.Hostname(),
|
||||
"port": portFromURL(u, 443),
|
||||
"uuid": userInfo(u),
|
||||
"udp": true,
|
||||
"flow": params.Get("flow"),
|
||||
"network": orDefault(params.Get("type"), "tcp"),
|
||||
"tls": security != "none",
|
||||
"name": fragmentName(u, fmt.Sprintf("vless-%d", index+1)),
|
||||
"type": "vless",
|
||||
"server": u.Hostname(),
|
||||
"port": portFromURL(u, 443),
|
||||
"uuid": userInfo(u),
|
||||
"udp": true,
|
||||
"flow": params.Get("flow"),
|
||||
"network": orDefault(params.Get("type"), "tcp"),
|
||||
"tls": security != "none",
|
||||
"servername": params.Get("sni"),
|
||||
"encryption": orDefault(params.Get("encryption"), "none"),
|
||||
"encryption": orDefault(params.Get("encryption"), "none"),
|
||||
"client-fingerprint": orDefault(params.Get("fp"), "chrome"),
|
||||
}
|
||||
if node["network"] == "ws" {
|
||||
wsOpts := map[string]any{
|
||||
"path": orDefault(params.Get("path"), "/"),
|
||||
}
|
||||
host := params.Get("host")
|
||||
if host != "" {
|
||||
wsOpts["headers"] = map[string]any{"Host": host}
|
||||
}
|
||||
node["ws-opts"] = wsOpts
|
||||
}
|
||||
if publicKey != "" {
|
||||
node["reality-opts"] = StripUndefined(map[string]any{
|
||||
"public-key": publicKey,
|
||||
@@ -251,17 +261,17 @@ func ParseVmess(line string, index int) model.ProxyNode {
|
||||
|
||||
port := toNumberOrUndefined(payload["port"])
|
||||
node := map[string]any{
|
||||
"name": orDefault(toString(payload["ps"]), fmt.Sprintf("vmess-%d", index+1)),
|
||||
"type": "vmess",
|
||||
"server": toString(payload["add"]),
|
||||
"port": port,
|
||||
"uuid": toString(payload["id"]),
|
||||
"alterId": toNumberOrUndefined(payload["aid"]),
|
||||
"cipher": orDefault(toString(payload["scy"]), "auto"),
|
||||
"tls": toString(payload["tls"]) == "tls",
|
||||
"name": orDefault(toString(payload["ps"]), fmt.Sprintf("vmess-%d", index+1)),
|
||||
"type": "vmess",
|
||||
"server": toString(payload["add"]),
|
||||
"port": port,
|
||||
"uuid": toString(payload["id"]),
|
||||
"alterId": toNumberOrUndefined(payload["aid"]),
|
||||
"cipher": orDefault(toString(payload["scy"]), "auto"),
|
||||
"tls": toString(payload["tls"]) == "tls",
|
||||
"servername": firstNonEmpty(toString(payload["sni"]), toString(payload["host"])),
|
||||
"network": orDefault(toString(payload["net"]), "tcp"),
|
||||
"udp": true,
|
||||
"network": orDefault(toString(payload["net"]), "tcp"),
|
||||
"udp": true,
|
||||
}
|
||||
if toString(payload["net"]) == "ws" {
|
||||
wsOpts := map[string]any{
|
||||
@@ -415,15 +425,15 @@ func ParseShadowsocksR(line string, index int) model.ProxyNode {
|
||||
}
|
||||
|
||||
node := map[string]any{
|
||||
"name": name,
|
||||
"type": "ssr",
|
||||
"server": server,
|
||||
"port": port,
|
||||
"cipher": method,
|
||||
"name": name,
|
||||
"type": "ssr",
|
||||
"server": server,
|
||||
"port": port,
|
||||
"cipher": method,
|
||||
"password": password,
|
||||
"protocol": protocol,
|
||||
"obfs": obfs,
|
||||
"udp": true,
|
||||
"obfs": obfs,
|
||||
"udp": true,
|
||||
}
|
||||
|
||||
if pp := query.Get("protoparam"); pp != "" {
|
||||
@@ -490,18 +500,18 @@ func ParseHttpProxy(line string, index int) model.ProxyNode {
|
||||
func ParseTuic(line string, index int) model.ProxyNode {
|
||||
u := parseURL(line)
|
||||
return StripUndefined(map[string]any{
|
||||
"name": fragmentName(u, fmt.Sprintf("tuic-%d", index+1)),
|
||||
"type": "tuic",
|
||||
"server": u.Hostname(),
|
||||
"port": portFromURL(u, 443),
|
||||
"uuid": userInfo(u),
|
||||
"password": userPassword(u),
|
||||
"sni": paramGet(u, "sni"),
|
||||
"alpn": CommaList(paramGet(u, "alpn")),
|
||||
"skip-cert-verify": BoolParam(firstNonEmpty(paramGet(u, "allow_insecure"), paramGet(u, "insecure"))),
|
||||
"disable-sni": BoolParam(firstNonEmpty(paramGet(u, "disable_sni"), paramGet(u, "disable-sni"))),
|
||||
"reduce-rtt": BoolParam(firstNonEmpty(paramGet(u, "reduce_rtt"), paramGet(u, "reduce-rtt"))),
|
||||
"udp-relay-mode": firstNonEmpty(paramGet(u, "udp_relay_mode"), paramGet(u, "udp-relay-mode")),
|
||||
"name": fragmentName(u, fmt.Sprintf("tuic-%d", index+1)),
|
||||
"type": "tuic",
|
||||
"server": u.Hostname(),
|
||||
"port": portFromURL(u, 443),
|
||||
"uuid": userInfo(u),
|
||||
"password": userPassword(u),
|
||||
"sni": paramGet(u, "sni"),
|
||||
"alpn": CommaList(paramGet(u, "alpn")),
|
||||
"skip-cert-verify": BoolParam(firstNonEmpty(paramGet(u, "allow_insecure"), paramGet(u, "insecure"))),
|
||||
"disable-sni": BoolParam(firstNonEmpty(paramGet(u, "disable_sni"), paramGet(u, "disable-sni"))),
|
||||
"reduce-rtt": BoolParam(firstNonEmpty(paramGet(u, "reduce_rtt"), paramGet(u, "reduce-rtt"))),
|
||||
"udp-relay-mode": firstNonEmpty(paramGet(u, "udp_relay_mode"), paramGet(u, "udp-relay-mode")),
|
||||
"congestion-controller": firstNonEmpty(paramGet(u, "congestion_control"), paramGet(u, "congestion-controller")),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user