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

Method DoSyncSNIProxy

internal/nodeapi/sniproxy.go:21–35  ·  view source on GitHub ↗

DoSyncSNIProxy 把完整 SNI 代理配置推给 manager 热更新。

(req sniproxy.ManagerConfig)

Source from the content-addressed store, hash-verified

19
20// DoSyncSNIProxy 把完整 SNI 代理配置推给 manager 热更新。
21func (a *API) DoSyncSNIProxy(req sniproxy.ManagerConfig) (SNIProxySyncResponse, error) {
22if a.sniManager == nil {
23return SNIProxySyncResponse{}, ErrSNIProxyNotConfigured
24}
25log.Printf("sniproxy apply: listen=%q routes=%d cf_token_set=%v",
26req.Listen, len(req.Routes), req.CloudflareToken != "")
27if err := a.sniManager.Apply(req); err != nil {
28return SNIProxySyncResponse{}, err
29}
30return SNIProxySyncResponse{
31Listen: req.Listen,
32Routes: len(req.Routes),
33Managed: a.sniManager.Config().Listen != "",
34}, nil
35}
36
37// DoSNIProxyStatus 返回当前 SNI 代理状态摘要。脱敏 cloudflare token。
38func (a *API) DoSNIProxyStatus() map[string]any {

Callers 1

HandleMethod · 0.80

Calls 2

ApplyMethod · 0.80
ConfigMethod · 0.65

Tested by

no test coverage detected