mirror of
https://github.com/chatmail/core.git
synced 2026-05-21 15:56:30 +03:00
feat: add unix socket support to deltachat-rpc-server
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Delta Chat RPC server
|
||||
|
||||
This program provides a [JSON-RPC 2.0](https://www.jsonrpc.org/specification) interface to DeltaChat
|
||||
over standard I/O.
|
||||
over standard I/O or UNIX sockets.
|
||||
|
||||
## Install
|
||||
|
||||
@@ -35,3 +35,25 @@ languages other than Rust, for example:
|
||||
|
||||
Run `deltachat-rpc-server --version` to check the version of the server.
|
||||
Run `deltachat-rpc-server --openrpc` to get [OpenRPC](https://open-rpc.org/) specification of the provided JSON-RPC API.
|
||||
|
||||
### Usage over unix sockets
|
||||
|
||||
> At this time this does not work on windows because rust does not support unix sockets on windows, yet (<https://github.com/rust-lang/rust/issues/150487>).
|
||||
|
||||
Standard I/O is the default option, but you can also tell `deltachat-rpc-server` to use a unix socket instead.
|
||||
|
||||
```
|
||||
deltachat-rpc-server --unix ./chatmail-core.sock
|
||||
```
|
||||
|
||||
While this technically allows multiple processes to communicate with the same rpc server instance,
|
||||
please note that there is still only event queue, so only one of these processed should read the events at a time.
|
||||
|
||||
You can test it with socat:
|
||||
```sh
|
||||
socat - UNIX-CONNECT:./chatmail-core.sock
|
||||
```
|
||||
Then paste the following jsonrpc command and press enter:
|
||||
```json
|
||||
{"method": "get_system_info","id": 1,"params": []}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user