* Extract numeric port from a URL string. * @param {string} urlString * @returns {number|null}
(urlString)
| 261 | * @returns {number|null} |
| 262 | */ |
| 263 | function extractPortFromURL(urlString) { |
| 264 | if (!urlString || typeof urlString !== "string") return null; |
| 265 | try { |
| 266 | const parsed = new URL(urlString); |
| 267 | if (!parsed.port) return null; |
| 268 | return Number(parsed.port); |
| 269 | } catch { |
| 270 | return null; |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | /** |
| 275 | * Read Codex openai-proxy base_url from config.toml content. |
no outgoing calls
no test coverage detected