Download the PHP package hi-folks/lara-sock without Composer

On this page you can find all versions of the php package hi-folks/lara-sock. 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 lara-sock

LaraSock

CI/CD Github Actions GitHub last commit GitHub Release Date Packagist PHP Version

This is an early stage (under construction/exploration) work in progress, so currently, the project only implements some of the functionalities you expect. Feel free to share if you want to contribute, providing Pull Request or suggestions. We believe in positive vibes.

Why LaraSock?

Larasock implements a WebSocket Server based on Open Swoole. The final goal is to support the same Application Providers supported by Laravel Octane (Swoole and Roadrunner). This package lets you easily add real-time functionalities via WebSocket to your Laravel/Octane application.

So, if you are already using Open Swoole with your Laravel Octane, you don't need additional services or external tools to enable the Web Socket functionalities.

Installing LaraSock

The LaraSock hi-folks/lara-sock is provided as a PHP package that you can install in your Laravel project. To install the package, you can use composer require command:

Starting the server

Installing the package in your Laravel project adds a new command with php artisan. The new larasock:start artisan command starts a long live running process that starts a Web Socket server, ready to listen and accept your Web Socket connection from clients.

Options

With the command, you can use some options:

The default host is 127.0.0.1, which means that it can receive connections from localhost clients. The default port is 9501.

If you want to accept connections from all the clients on the network, you have to "bind" to 0.0.0.0 IP address:

If you have Tmux installed, you can use it to start the Octane Web server and the WebSocket server on the same screen.

The client

Once you start the Web Socket Server, you can create your Web client to send and receive messages. You can implement your HTML page using the WebSocket Javascript class.

A note about the Subprotocol

WebSocket defines a protocol that allows clients and servers to exchange data (messages). A Sub-protocol defines the exchange message's structure and the meanings of each field. For example, you want to exchange a pure string with a text message without additional information. Or you want to exchange data with a more complex structure.

The current implementation of this Proof of Concept exchanges messages in string format.

Next Step, the evolution of the Proof of Concept

This is just a Proof of Concept, the thing that I would like to focus on (and feel free to share any suggestion/feedback/pull request):

The package is under construction, so if you have some suggestions, you can:

Contributing

Please see CONTRIBUTING for details.

Submit ideas or feature requests, or issues

The package is under construction, so if you have some suggestions, you can:

Credits

Who talks about LaraSock

License

The MIT License (MIT). Please see License File for more information.


All versions of lara-sock with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2
openswoole/core Version 22.1.2
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 hi-folks/lara-sock contains the following files

Loading the files please wait ....