From 21098d26275071e37897f88f8789812a4298f847 Mon Sep 17 00:00:00 2001 From: Skyxim Date: Sat, 18 Jun 2022 17:29:19 +0800 Subject: [PATCH] feat: RESTful api add interface-name field on patch config --- hub/route/configs.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hub/route/configs.go b/hub/route/configs.go index f87fa5ce..82f65284 100644 --- a/hub/route/configs.go +++ b/hub/route/configs.go @@ -46,6 +46,7 @@ type configSchema struct { IPv6 *bool `json:"ipv6"` Sniffing *bool `json:"sniffing"` TcpConcurrent *bool `json:"tcp-concurrent"` + InterfaceName *string `json:"interface-name"` } func getConfigs(w http.ResponseWriter, r *http.Request) { @@ -85,6 +86,10 @@ func patchConfigs(w http.ResponseWriter, r *http.Request) { dialer.SetDial(*general.TcpConcurrent) } + if general.InterfaceName != nil { + dialer.DefaultInterface.Store(*general.InterfaceName) + } + ports := P.GetPorts() tcpIn := tunnel.TCPIn()