fix wsl default listen host (#542)
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import { resolve } from 'path'
|
||||
import { homedir } from 'os'
|
||||
|
||||
export function getListenHost(env: Record<string, string | undefined> = process.env): string | undefined {
|
||||
export function getListenHost(env: Record<string, string | undefined> = process.env): string {
|
||||
const host = env.BIND_HOST?.trim()
|
||||
return host || undefined
|
||||
return host || '0.0.0.0'
|
||||
}
|
||||
|
||||
export const config = {
|
||||
port: parseInt(process.env.PORT || '8648', 10),
|
||||
// Default undefined: listenWithFallback tries :: first, falls back to 0.0.0.0
|
||||
// Default to IPv4 for stable WSL/Windows browser access. Use BIND_HOST=:: explicitly for IPv6.
|
||||
host: getListenHost(),
|
||||
upstream: process.env.UPSTREAM || 'http://127.0.0.1:8642',
|
||||
uploadDir: process.env.UPLOAD_DIR || resolve(homedir(), '.hermes-web-ui', 'upload'),
|
||||
|
||||
Reference in New Issue
Block a user