移除无用依赖
This commit is contained in:
@@ -19,7 +19,6 @@ import (
|
|||||||
vlessin "github.com/xtls/xray-core/proxy/vless/inbound"
|
vlessin "github.com/xtls/xray-core/proxy/vless/inbound"
|
||||||
"github.com/xtls/xray-core/proxy/vmess"
|
"github.com/xtls/xray-core/proxy/vmess"
|
||||||
vmessin "github.com/xtls/xray-core/proxy/vmess/inbound"
|
vmessin "github.com/xtls/xray-core/proxy/vmess/inbound"
|
||||||
"github.com/xtls/xray-core/proxy/wireguard"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// AddVMessInbound demonstrates HandlerServiceClient.AddInbound for VMess inbound.
|
// AddVMessInbound demonstrates HandlerServiceClient.AddInbound for VMess inbound.
|
||||||
@@ -247,28 +246,3 @@ func AddLoopbackInbound(ctx context.Context, client command.HandlerServiceClient
|
|||||||
return err
|
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
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import (
|
|||||||
vlessout "github.com/xtls/xray-core/proxy/vless/outbound"
|
vlessout "github.com/xtls/xray-core/proxy/vless/outbound"
|
||||||
"github.com/xtls/xray-core/proxy/vmess"
|
"github.com/xtls/xray-core/proxy/vmess"
|
||||||
vmessout "github.com/xtls/xray-core/proxy/vmess/outbound"
|
vmessout "github.com/xtls/xray-core/proxy/vmess/outbound"
|
||||||
"github.com/xtls/xray-core/proxy/wireguard"
|
|
||||||
"github.com/xtls/xray-core/transport/internet"
|
"github.com/xtls/xray-core/transport/internet"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -197,25 +196,3 @@ func AddVMessOutbound(ctx context.Context, client command.HandlerServiceClient,
|
|||||||
return err
|
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
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user