MCPcopy Create free account
hub / github.com/PasarGuard/node / collectUnixSocketPaths

Function collectUnixSocketPaths

backend/xray/core.go:126–158  ·  view source on GitHub ↗
(cfg *Config)

Source from the content-addressed store, hash-verified

124}
125
126func collectUnixSocketPaths(cfg *Config) []string {
127 if cfg == nil {
128 return nil
129 }
130
131 seen := make(map[string]struct{})
132 paths := make([]string, 0)
133
134 for _, inbound := range cfg.InboundConfigs {
135 if inbound == nil {
136 continue
137 }
138
139 listen := strings.TrimSpace(inbound.Listen)
140 if listen == "" {
141 continue
142 }
143
144 path, _, _ := strings.Cut(listen, ",")
145 path = strings.TrimSpace(path)
146 if !strings.HasPrefix(path, "/") {
147 continue
148 }
149
150 if _, ok := seen[path]; ok {
151 continue
152 }
153 seen[path] = struct{}{}
154 paths = append(paths, path)
155 }
156
157 return paths
158}
159
160func removeUnixSocketFiles(paths []string) {
161 for _, path := range paths {

Callers 3

StartMethod · 0.85

Calls

no outgoing calls

Tested by 2