MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / handleNodeSNIProxySync

Method handleNodeSNIProxySync

internal/serverapi/sniproxy.go:56–68  ·  view source on GitHub ↗

handleNodeSNIProxySync 暴露给面板的手动同步入口,POST /v1/nodes/{id}/sniproxy/sync。 处理节点 NodeGate (sniproxy) 同步请求。

(w http.ResponseWriter, r *http.Request, nodeID string)

Source from the content-addressed store, hash-verified

54// handleNodeSNIProxySync 暴露给面板的手动同步入口,POST /v1/nodes/{id}/sniproxy/sync。
55// 处理节点 NodeGate (sniproxy) 同步请求。
56func (a *API) handleNodeSNIProxySync(w http.ResponseWriter, r *http.Request, nodeID string) {
57 if r.Method != http.MethodPost {
58 writeMethodNotAllowed(w, http.MethodPost)
59 return
60 }
61 ctx, cancel := context.WithTimeout(r.Context(), 15*time.Second)
62 defer cancel()
63 if err := a.doSyncNodeSNIProxy(ctx, nodeID); err != nil {
64 writeNodeError(w, err)
65 return
66 }
67 writeJSON(w, http.StatusOK, map[string]any{"ok": true})
68}
69
70// handleNodeSNIProxyStatus 代理到节点读取当前 SNI 代理的运行状态。
71// 面板用这个接口展示监听端口、路由表、证书明细和错误。

Callers 1

handleNodeRoutesMethod · 0.95

Calls 4

doSyncNodeSNIProxyMethod · 0.95
writeMethodNotAllowedFunction · 0.85
writeNodeErrorFunction · 0.85
writeJSONFunction · 0.70

Tested by

no test coverage detected