-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
Problem
surf-cli hardcodes Unix socket paths as /tmp/surf.sock across 4 files in native/. On Windows, /tmp/ doesn't exist and Unix domain sockets aren't supported, so every surf command fails with:
Error: Socket not found. Is Chrome running with the extension?
This is the same user-facing error as #42, but with a different root cause — on Windows the socket path itself is invalid, whereas #42 reports the issue on macOS where the path is valid but the socket isn't being created.
Affected files
| File | Hardcoded path |
|---|---|
native/cli.cjs |
const SOCKET_PATH = "/tmp/surf.sock" |
native/do-executor.cjs |
const SOCKET_PATH = "/tmp/surf.sock" |
native/host.cjs |
const SOCKET_PATH = "/tmp/surf.sock" + const LOG_FILE = "/tmp/surf-host.log" |
native/mcp-server.cjs |
const SOCKET_PATH = "/tmp/surf.sock" |
Proposed fix
Use Windows named pipes on win32 and os.tmpdir() on Unix:
const SOCKET_PATH = process.platform === "win32"
? "\\.\pipe\surf-sock"
: path.join(os.tmpdir(), "surf.sock");This approach:
- Uses Windows named pipes (
\.\pipe\surf-sock) which are the Windows equivalent of Unix domain sockets - Falls back to
os.tmpdir()instead of hardcoded/tmp/for better cross-platform support on Unix too - Requires adding
osandpathimports todo-executor.cjsandmcp-server.cjs(already present in the other files)
Environment
- Windows 11 Pro
- Node.js v22
- surf-cli installed via
npm install -g
I have a PR ready with the fix — will link it here.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels