(cfg: ParsedProxyConfig)
| 116 | |
| 117 | /** Convert a ParsedProxyConfig to the UpstreamConfig shape socks-bridge wants. */ |
| 118 | export function toUpstreamConfig(cfg: ParsedProxyConfig): UpstreamConfig { |
| 119 | return { |
| 120 | host: cfg.host, |
| 121 | port: cfg.port, |
| 122 | ...(cfg.userId ? { userId: cfg.userId } : {}), |
| 123 | ...(cfg.password ? { password: cfg.password } : {}), |
| 124 | }; |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * Compute a stable hash of (proxyUrl + headed flag) for daemon-mismatch |