Files
orca/src/relay/relay-test-socket-path.ts
T
0ec3882cb8 Add project Windows runtime selection (#5519)
* Add project Windows runtime selection

* Fix project Windows runtime selection

Co-authored-by: Orca <help@stably.ai>

* fix: preserve WSL shell variables

---------

Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Neil <neil@stably.ai>
2026-06-17 16:08:14 -07:00

18 lines
537 B
TypeScript

import { createHash } from 'crypto'
import { join } from 'path'
export function relayTestSocketPath(dir: string, name = 'relay.sock'): string {
if (process.platform !== 'win32') {
return join(dir, name)
}
const suffix = createHash('sha256')
.update(`${process.pid}\0${dir}\0${name}`)
.digest('hex')
.slice(0, 20)
// Why: Node's net server requires Windows IPC endpoints to be named pipes;
// filesystem-style .sock paths fail with EACCES on Windows hosts.
return `\\\\.\\pipe\\orca-relay-test-${suffix}`
}