summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorHDK1999 <[email protected]>2023-06-14 00:16:53 +0800
committerHDK1999 <[email protected]>2023-06-14 00:16:53 +0800
commit6267af4cb566429976dc019cf45a5b0912e24032 (patch)
treed41a028e644e234985c322a6be29d010c712bc27 /core
parent8e5f161e8848517802ddeedf92d2335322b73d12 (diff)
pkg/prober插件修改
Diffstat (limited to 'core')
-rw-r--r--core/dnsserver/prober_http.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/core/dnsserver/prober_http.go b/core/dnsserver/prober_http.go
index 8d4fbbe..7f3b96b 100644
--- a/core/dnsserver/prober_http.go
+++ b/core/dnsserver/prober_http.go
@@ -124,9 +124,15 @@ func (p *ProberHTTP) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// act: res代表获取当前所有Prober状态,new代表新建Prober
// ptype: 探针类型,v64代表IPv4-IPv6关联发现的探针
// prange: 探测范围,默认全局,
- if param["act"][0] == "new" {
- // 添加一个探测器并启动它
- proberlist.AddProber(param)
+ if v, ok := param["act"]; ok {
+ if v[0] == "new" {
+ // 添加一个探测器并启动它
+ proberlist.AddProber(param)
+ } else {
+ // 查询所有探测器状态
+ }
+ } else {
+ // 不含有act参数,默认为查询
}
// TODO:设定响应头部