procbridge icon indicating copy to clipboard operation
procbridge copied to clipboard

Unix Domain socket support

Open rjborba opened this issue 5 years ago • 1 comments

Hi. By any change is unix domain socket support in the plans? Sometime we just need IPC between process running in the same machine

rjborba avatar Aug 19 '19 11:08 rjborba

@rjborba Just updated procbridge-python (==1.2.0) and procbridge-nodejs (==1.1.0). They support unix domain socket. Documentation will be added later.

For python:

import procbridge as pb
# inet socket:
server = pb.Server('0.0.0.0', PORT, delegate)
client = pb.Client('127.0.0.1', 8000)
# unix domain socket:
server = pb.Server.from_unix('/path/to/my/sock', delegate)
client = pb.Client.from_unix('/path/to/my/sock')

For Node.js:

const { Server, Client } = require('procbridge')
# inet socket:
const server = new Server('0.0.0.0', 8000, delegate)
const client = new Client('127.0.0.1', 8000)
# unix domain socket:
const server = new Server('/path/to/my/sock', delegate)
const client = new Client('/path/to/my/sock')

gongzhang avatar Aug 20 '19 09:08 gongzhang