-- sing-box (JSON with typed outbounds) ---------------------------------
()
| 176 | // -- sing-box (JSON with typed outbounds) --------------------------------- |
| 177 | |
| 178 | func detectSingBox() (Client, bool) { |
| 179 | bin, err := exec.LookPath("sing-box") |
| 180 | if err != nil { |
| 181 | return Client{}, false |
| 182 | } |
| 183 | for _, p := range singBoxConfigPaths() { |
| 184 | if _, err := os.Stat(p); err == nil { |
| 185 | return Client{ |
| 186 | Name: "sing-box", |
| 187 | Binary: bin, |
| 188 | ConfigPath: p, |
| 189 | Patch: singBoxPatcher(p), |
| 190 | }, true |
| 191 | } |
| 192 | } |
| 193 | return Client{}, false |
| 194 | } |
| 195 | |
| 196 | func singBoxPatcher(path string) func(string, uint16) error { |
| 197 | return func(origHost string, origPort uint16) error { |
no test coverage detected