MCPcopy Create free account
hub / github.com/AandStep/ResultV / SingBoxEngine

Struct SingBoxEngine

internal/proxy/singbox.go:86–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84
85
86type SingBoxEngine struct {
87 mu sync.Mutex
88 running atomic.Bool
89 log *logger.Logger
90 cancel context.CancelFunc
91 configPath string
92 instance *box.Box
93
94 // savedCfg / savedCtx are the original Start args, kept so ApplyAppWhitelist
95 // can rebuild the sing-box config in-place without reconstructing the
96 // caller's intent. They are only meaningful while running.
97 savedCfg EngineConfig
98 savedCtx context.Context
99
100
101 uploadBytes atomic.Int64
102 downloadBytes atomic.Int64
103
104 // proxyUploadBytes/proxyDownloadBytes count ONLY traffic carried by the
105 // proxy/endpoint outbound (the tracker increments them only when the matched
106 // outbound is not direct/block). The watchdog's traffic veto reads these so
107 // direct/split-tunnel traffic cannot make a dead upstream look alive.
108 proxyUploadBytes atomic.Int64
109 proxyDownloadBytes atomic.Int64
110}
111
112
113type singBoxLogWriter struct {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected