Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
node: [lts/*]
fail-fast: true
steps:
Expand Down
6 changes: 6 additions & 0 deletions packages/rpc/src/rpc-client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import * as net from 'net'
import { platform } from 'os'
import Path from 'path'
import * as cborg from 'cborg'
import * as lp from 'it-length-prefixed'
import { pipe } from 'it-pipe'
Expand All @@ -17,6 +19,10 @@ export class RPCClient {
private readonly stream = pushable<JSONRPCRequest>({ objectMode: true })

constructor (path: string) {
if (platform() === 'win32') {
path = Path.join('\\\\.\\pipe', path)
}

this.socket = net.connect({ path })

this.rpc = new JSONRPCClient((request: JSONRPCRequest, options) => {
Expand Down
6 changes: 6 additions & 0 deletions packages/rpc/src/rpc-server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import * as net from 'net'
import { platform } from 'os'
import Path from 'path'
import * as cborg from 'cborg'
import * as lp from 'it-length-prefixed'
import { pipe } from 'it-pipe'
Expand Down Expand Up @@ -32,6 +34,10 @@ export class RPCServer {
private readonly options: Required<RPCServerOptions>

constructor (path: string, options: RPCServerOptions = {}) {
if (platform() === 'win32') {
path = Path.join('\\\\.\\pipe', path)
}

this.path = path

this.options = {
Expand Down