ProcBridge is a super-lightweight IPC (Inter-Process Communication) protocol over TCP socket. It enables you to send and recieve JSON between processes easily. ProcBridge is much like a simplified version of HTTP protocol, but only transfer JSON values.
On the server side, you define a function which handles requests and returns result. On the client side, you just make request and get results synchronously. Both requests and responses are wildcard JSON values (null, boolean, number, string, object, and array).
ProcBridge has been implemented in Java, Python, Node.js, Swift, and C#. If you want to connect two processes and HTTP & RPC are too heavy for your scenario, then ProcBridge will be an ideal choice.
Please go to sub-repos for more information.
- ✅ Java - gongzhang/procbridge-java
- ✅ Python - gongzhang/procbridge-python
- ✅ Node.js - gongzhang/procbridge-nodejs
- ✅ Swift - royalstream/procbridge-swift
- Alternative: gongzhang/procbridge-swift (WIP but supported Unix domain socket already)
- ✅ C# - IXI01/procbridge-csharp
⚠️ Go - not yet supported
Both request and response are encoded into ProcBridge Packets. Those binary packets are sent over TCP socket directly. Talk is cheap, please read Python implementation to fully understand the protocol design.
👀 Note for Early Collaborators (2019-01-10)
The library implementations have been refactored and migrated to sub-repos as described above. From now on, this repo only stores docs. If you worked on master
branch before, please switch to legacy
branch. Thank you for your understanding and support. 😼
Below is the collaboration guideline:
If you want to extend the protocol, for example:
- support packet compression
- support bidirectional communication
- support long connection and event-based communication
- define conventions to method name or JSON body
Please open an issue first.
You can quickly implement ProcBridge in any other programming languages. Note that it only takes 300 lines of code to fully implement the protocol in Python. Please name your repo like procbridge-xxx
where xxx
is your programming language. Don't forget to open an issue to let me know it.
Cool. Please open PR in sub-repos.
👨🏻💻 Gong Zhang ([email protected])