Download the PHP package webnarmin/amphp-websocket-server without Composer

On this page you can find all versions of the php package webnarmin/amphp-websocket-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 amphp-websocket-server

AmPHP WebSocket Server

A flexible and efficient WebSocket server implementation using the Amp concurrency framework for PHP. This library enables developers to create real-time, interactive web applications with ease, providing features such as authentication, message handling, broadcasting, and more. It is designed to be scalable and efficient, making it ideal for high-performance applications.

Features

Table of Contents

Installation

Install via Composer:

Quick Start

1. Create a WebSocket Server Class

First, extend the WebSocketServer class and define your message handlers:

2. Set Up and Run the Server

Next, configure and run your WebSocket server:

Note on SimpleAuthenticator and SimpleWebsocketUser

The classes SimpleAuthenticator and SimpleWebsocketUser are provided as basic examples. They cover essential functionalities but can be extended or replaced with custom implementations to fit specific needs.

Usage

Server-side Setup

To create a custom WebSocket server, extend the WebSocketServer class and implement your desired message handlers:

Client-side Usage

Connect to the WebSocket server from your client-side JavaScript:

Token and Public Key

Generate the token and public key on the server side:

Pass these values to your client-side code for connection.

Broadcasting from CLI

Create a PHP script to broadcast messages from the command line:

Run this script from the command line to broadcast a message to all connected clients.

Configuration

Configuration options can be set when creating the Configurator instance:

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.


All versions of amphp-websocket-server with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
amphp/websocket-server Version ^4.0
amphp/http-server-router Version ^2.0
amphp/log Version ^2.0
guzzlehttp/guzzle Version ^7.0
webnarmin/cryptor Version ^1.0
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 webnarmin/amphp-websocket-server contains the following files

Loading the files please wait ....