()
| 189 | * 3. `http://localhost:3002` for local development and SSR. |
| 190 | */ |
| 191 | export function getSocketUrl(): string { |
| 192 | const explicit = getEnv('NEXT_PUBLIC_SOCKET_URL')?.trim() |
| 193 | if (explicit) return explicit |
| 194 | |
| 195 | const browserOrigin = getBrowserOrigin() |
| 196 | if (browserOrigin && !LOCALHOST_HOSTNAMES.has(new URL(browserOrigin).hostname)) { |
| 197 | return browserOrigin |
| 198 | } |
| 199 | |
| 200 | return DEFAULT_SOCKET_URL |
| 201 | } |
| 202 | |
| 203 | /** |
| 204 | * Returns the Ollama server URL. |
no test coverage detected