Download the PHP package php-websocket-rpc/rpc-server without Composer

On this page you can find all versions of the php package php-websocket-rpc/rpc-server. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package rpc-server

php-websocket-rpc/rpc-server

Async RPC server over WebSocket using amphp and msgpack.

Install

Requires PHP 8.5+, ext-msgpack, and the amphp ecosystem.

Quick Start

The client then uses createProxy():

Features

Authentication & Authorization

You must implement AuthenticationProvider to validate tokens and AuthorizationProvider to authorize method calls. The framework provides built-in implementations for testing. The AuthService is automatically registered and can be used to authenticate clients. The ClientSessionContext is a fiber-safe accessor for session attributes.

Quick Setup

Protecting Methods

Use the #[NeedAuthorization] attribute on your contract interface:

Client Flow

Custom Authentication Provider

Implement AuthenticationProvider to use JWT, database, or any other logic:

Custom Authorization Provider

For fine-grained authorization (resource ownership, IP checks, etc.):

Statelessness

The AuthenticationProvider::validateToken() method must be stateless for cross-replica deployments. Use JWT (self-contained) or look up from a shared store (Redis/DB). It returns a Token value object (id, issuer, subject, audience, expiry) — the actual user data is resolved separately via UserProvider::getUser(). The framework only stores the authenticated user per-WebSocket-connection in memory, which is freed on disconnect.

Contract Services

Define an interface with attributes:

Register the implementation:

Architecture

The server uses a builder + adapter pattern to keep the core framework-agnostic:

Key Classes

Class Purpose
PhpWebsocketRpc\RpcServer\Server\RpcServerBuilder Fluent builder — configure services, middleware, auth, then build()
PhpWebsocketRpc\RpcServer\Server\RpcServer Runtime core — dispatches messages, manages sessions, no amphp deps
PhpWebsocketRpc\RpcServer\Adapter\AmpWebSocketServerAdapter Bridges amphp HTTP/WebSocket to RpcServer
PhpWebsocketRpc\RpcServer\Server\RpcDispatcher Composes middleware pipeline with router dispatch
PhpWebsocketRpc\RpcServer\Server\ContractRegistry Manages contract service implementations
PhpWebsocketRpc\RpcServer\Server\ClientSession Represents a connected client
PhpWebsocketRpc\RpcServer\Stream\StreamChannel Manages a named stream channel
PhpWebsocketRpc\RpcServer\Middleware\RateLimiterMiddleware Rate limiting middleware
PhpWebsocketRpc\RpcServer\Auth\AuthenticationProvider Interface for token validation (returns Token)
PhpWebsocketRpc\RpcServer\Auth\UserProvider Interface for resolving user details from a token subject
PhpWebsocketRpc\RpcServer\Auth\AuthorizationProvider Interface for fine-grained authorization
PhpWebsocketRpc\RpcServer\Auth\StaticTokenAuthenticationProvider Simple static-token auth provider
PhpWebsocketRpc\RpcServer\Auth\InMemoryUserProvider Simple in-memory user provider for testing
PhpWebsocketRpc\RpcServer\Auth\AuthService Built-in auth handler (auto-registered)
PhpWebsocketRpc\RpcServer\Auth\ClientSessionContext Fiber-safe session accessor
PhpWebsocketRpc\Rpc\Transport\Amp\Client Wraps amphp's WebsocketClient for RpcServer
PhpWebsocketRpc\Rpc\Transport\FramedConnection Serializes/deserializes Payload over binary WebSocket

All versions of rpc-server with dependencies

PHP Build Version
Package Version
Requires php Version >=8.5
ext-msgpack Version *
amphp/amp Version ^3
amphp/websocket-server Version ^4
amphp/http-server Version ^3
amphp/http-server-router Version ^2
psr/log Version ^3
php-websocket-rpc/rpc Version ^0.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package php-websocket-rpc/rpc-server contains the following files

Loading the files please wait ...