( end: Pick<Backend, 'type' | 'protocol' | 'host' | 'port'>, )
| 72 | |
| 73 | // sing-box native 后端复用顶层连接字段作为 gRPC baseUrl(secondaryPath 留空)。 |
| 74 | export const getSingboxUrlFromBackend = ( |
| 75 | end: Pick<Backend, 'type' | 'protocol' | 'host' | 'port'>, |
| 76 | ) => { |
| 77 | if (end.type !== 'singbox' || !end.host) return '' |
| 78 | return `${end.protocol}://${end.host}:${end.port}` |
| 79 | } |
| 80 | |
| 81 | export const getSingboxSecret = (end: Pick<Backend, 'type' | 'password'>) => |
| 82 | end.type === 'singbox' ? end.password || '' : '' |
no outgoing calls
no test coverage detected