feat: RESTful API support disable sniffer
This commit is contained in:
@ -119,6 +119,8 @@ func GetGeneral() *config.General {
|
||||
IPv6: !resolver.DisableIPv6,
|
||||
GeodataLoader: G.LoaderName(),
|
||||
Tun: P.GetTunConf(),
|
||||
Interface: dialer.DefaultInterface.Load(),
|
||||
Sniffing: tunnel.IsSniffing(),
|
||||
}
|
||||
|
||||
return general
|
||||
|
@ -36,6 +36,7 @@ type configSchema struct {
|
||||
Mode *tunnel.TunnelMode `json:"mode"`
|
||||
LogLevel *log.LogLevel `json:"log-level"`
|
||||
IPv6 *bool `json:"ipv6"`
|
||||
Sniffing *bool `json:"sniffing"`
|
||||
}
|
||||
|
||||
func getConfigs(w http.ResponseWriter, r *http.Request) {
|
||||
@ -67,6 +68,10 @@ func patchConfigs(w http.ResponseWriter, r *http.Request) {
|
||||
P.SetBindAddress(*general.BindAddress)
|
||||
}
|
||||
|
||||
if general.Sniffing != nil {
|
||||
tunnel.SetSniffing(*general.Sniffing)
|
||||
}
|
||||
|
||||
ports := P.GetPorts()
|
||||
|
||||
tcpIn := tunnel.TCPIn()
|
||||
|
Reference in New Issue
Block a user