From 709c604c76964f84b5796844054b8082bf855106 Mon Sep 17 00:00:00 2001 From: iluobei Date: Thu, 12 Mar 2026 18:17:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=97=A0=E7=94=A8=E4=BE=9D?= =?UTF-8?q?=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/xrpc/services/handler/inbound.go | 26 ---------------------- internal/xrpc/services/handler/outbound.go | 23 ------------------- 2 files changed, 49 deletions(-) diff --git a/internal/xrpc/services/handler/inbound.go b/internal/xrpc/services/handler/inbound.go index 4bcfe66..f8fc4c9 100644 --- a/internal/xrpc/services/handler/inbound.go +++ b/internal/xrpc/services/handler/inbound.go @@ -19,7 +19,6 @@ import ( vlessin "github.com/xtls/xray-core/proxy/vless/inbound" "github.com/xtls/xray-core/proxy/vmess" vmessin "github.com/xtls/xray-core/proxy/vmess/inbound" - "github.com/xtls/xray-core/proxy/wireguard" ) // AddVMessInbound demonstrates HandlerServiceClient.AddInbound for VMess inbound. @@ -247,28 +246,3 @@ func AddLoopbackInbound(ctx context.Context, client command.HandlerServiceClient return err } -// AddWireGuardInbound sets up a WireGuard entry point with a single peer. -func AddWireGuardInbound(ctx context.Context, client command.HandlerServiceClient, tag string, port uint32) error { - cfg := &wireguard.DeviceConfig{ - SecretKey: "yAnExampleSecretKeyBase64==", - Endpoint: []string{":51820"}, - Mtu: 1420, - NumWorkers: 2, - DomainStrategy: wireguard.DeviceConfig_FORCE_IP46, - Peers: []*wireguard.PeerConfig{ - { - PublicKey: "peerPublicKeyBase64==", - Endpoint: "203.0.113.1:51820", - KeepAlive: 25, - AllowedIps: []string{"0.0.0.0/0", "::/0"}, - }, - }, - } - inbound := inboundConfig( - tag, - receiverSettings(port, false), - serial.ToTypedMessage(cfg), - ) - _, err := client.AddInbound(ctx, &command.AddInboundRequest{Inbound: inbound}) - return err -} diff --git a/internal/xrpc/services/handler/outbound.go b/internal/xrpc/services/handler/outbound.go index 47f62ac..d828f15 100644 --- a/internal/xrpc/services/handler/outbound.go +++ b/internal/xrpc/services/handler/outbound.go @@ -19,7 +19,6 @@ import ( vlessout "github.com/xtls/xray-core/proxy/vless/outbound" "github.com/xtls/xray-core/proxy/vmess" vmessout "github.com/xtls/xray-core/proxy/vmess/outbound" - "github.com/xtls/xray-core/proxy/wireguard" "github.com/xtls/xray-core/transport/internet" ) @@ -197,25 +196,3 @@ func AddVMessOutbound(ctx context.Context, client command.HandlerServiceClient, return err } -func AddWireGuardOutbound(ctx context.Context, client command.HandlerServiceClient, tag string) error { - cfg := outboundConfig( - tag, - senderSettings(), - serial.ToTypedMessage(&wireguard.DeviceConfig{ - SecretKey: "clientSecretKeyBase64==", - Endpoint: []string{"198.51.100.2:51820"}, - IsClient: true, - Mtu: 1420, - DomainStrategy: wireguard.DeviceConfig_FORCE_IP4, - Peers: []*wireguard.PeerConfig{ - { - PublicKey: "serverPublicKeyBase64==", - AllowedIps: []string{"0.0.0.0/0"}, - KeepAlive: 30, - }, - }, - }), - ) - _, err := client.AddOutbound(ctx, &command.AddOutboundRequest{Outbound: cfg}) - return err -}