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
os and path imports to do-executor.cjs and mcp-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.
Problem
surf-cli hardcodes Unix socket paths as
/tmp/surf.sockacross 4 files innative/. On Windows,/tmp/doesn't exist and Unix domain sockets aren't supported, so every surf command fails with: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
native/cli.cjsconst SOCKET_PATH = "/tmp/surf.sock"native/do-executor.cjsconst SOCKET_PATH = "/tmp/surf.sock"native/host.cjsconst SOCKET_PATH = "/tmp/surf.sock"+const LOG_FILE = "/tmp/surf-host.log"native/mcp-server.cjsconst SOCKET_PATH = "/tmp/surf.sock"Proposed fix
Use Windows named pipes on
win32andos.tmpdir()on Unix:This approach:
\.\pipe\surf-sock) which are the Windows equivalent of Unix domain socketsos.tmpdir()instead of hardcoded/tmp/for better cross-platform support on Unix tooosandpathimports todo-executor.cjsandmcp-server.cjs(already present in the other files)Environment
npm install -gI have a PR ready with the fix — will link it here.