feat: RESTful api add interface-name field on patch config

This commit is contained in:
Skyxim 2022-06-18 17:29:19 +08:00
parent 54a0947bb4
commit 21098d2627

View file

@ -46,6 +46,7 @@ type configSchema struct {
IPv6 *bool `json:"ipv6"` IPv6 *bool `json:"ipv6"`
Sniffing *bool `json:"sniffing"` Sniffing *bool `json:"sniffing"`
TcpConcurrent *bool `json:"tcp-concurrent"` TcpConcurrent *bool `json:"tcp-concurrent"`
InterfaceName *string `json:"interface-name"`
} }
func getConfigs(w http.ResponseWriter, r *http.Request) { func getConfigs(w http.ResponseWriter, r *http.Request) {
@ -85,6 +86,10 @@ func patchConfigs(w http.ResponseWriter, r *http.Request) {
dialer.SetDial(*general.TcpConcurrent) dialer.SetDial(*general.TcpConcurrent)
} }
if general.InterfaceName != nil {
dialer.DefaultInterface.Store(*general.InterfaceName)
}
ports := P.GetPorts() ports := P.GetPorts()
tcpIn := tunnel.TCPIn() tcpIn := tunnel.TCPIn()