handleNodeSNIProxySync 暴露给面板的手动同步入口,POST /v1/nodes/{id}/sniproxy/sync。 处理节点 NodeGate (sniproxy) 同步请求。
(w http.ResponseWriter, r *http.Request, nodeID string)
| 54 | // handleNodeSNIProxySync 暴露给面板的手动同步入口,POST /v1/nodes/{id}/sniproxy/sync。 |
| 55 | // 处理节点 NodeGate (sniproxy) 同步请求。 |
| 56 | func (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 | // 面板用这个接口展示监听端口、路由表、证书明细和错误。 |
no test coverage detected