PHPackages                             reactphp-x/rpc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. reactphp-x/rpc

ActiveLibrary[Queues &amp; Workers](/categories/queues)

reactphp-x/rpc
==============

A ReactPHP-based RPC library

1.0.0(6mo ago)0251MITPHPPHP ^8.1

Since Nov 1Pushed 6mo agoCompare

[ Source](https://github.com/reactphp-x/rpc)[ Packagist](https://packagist.org/packages/reactphp-x/rpc)[ RSS](/packages/reactphp-x-rpc/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (1)

ReactphpX RPC
=============

[](#reactphpx-rpc)

A ReactPHP-based JSON-RPC library that provides HTTP and TCP transport implementations for JSON-RPC 2.0 protocol.

Features
--------

[](#features)

- ✅ **HTTP Transport**: Full HTTP/HTTPS support using ReactPHP HTTP
- ✅ **TCP Transport**: TCP-based transport using NDJSON (Newline Delimited JSON)
- ✅ **ChildProcess Transport**: Inter-process communication using child processes
- ✅ **JSON-RPC 2.0**: Full compliance with JSON-RPC 2.0 specification
- ✅ **Async/Await**: Built on ReactPHP for non-blocking, event-driven operations
- ✅ **Type Safety**: Full PHP 8.1+ type hints and strict types
- ✅ **Access Logging**: Built-in `AccessLogHandler` for detailed request/response logging
- ✅ **Error Handling**: Comprehensive error handling with JSON-RPC 2.0 compliant error responses
- ✅ **Persistent Connections**: TCP transport supports persistent connections for better performance
- ✅ **Batch Requests**: Support for batch JSON-RPC calls on all transports

Installation
------------

[](#installation)

```
composer require reactphp-x/rpc
```

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- ReactPHP Event Loop
- ReactPHP HTTP (for HTTP transport)
- ReactPHP Socket (included with ReactPHP HTTP)
- clue/ndjson-react (for TCP transport)
- hcs-llc/php-json-rpc (JSON-RPC protocol implementation)

Quick Start
-----------

[](#quick-start)

### HTTP Server Example

[](#http-server-example)

```
