Download the PHP package xiaochengfu/swoole-websocket without Composer

On this page you can find all versions of the php package xiaochengfu/swoole-websocket. 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 swoole-websocket

websocket-Swoole php框架扩展

扩展说明

基于swoole开发的websocket实时推送、主动推送、长连接扩展,应用于php的各类框架,如thinkphp,yii2,laravel等

如何使用

安装

配置

1.将params_swoole.php.default配置文件放到你框架配置文件夹下 推荐放到config下:

2.修改配置文件

如何修改,配置文件中有具体说明

启动

根据每个框架的自定义命令,设置对应的指令即可,以启动为例

扩展支持

a.启动服务 serviceStart

b.查看服务状态 serviceStats

c.查看进程列表 serviceList

d.停止服务 serviceStop

场景测试

1.连接socket

访问http://www.websocket-test.com,输入ip:9512,进行连接测试

2.测试推送

推送通过http请求触发,在你要触发推送的action中,添加

正确的话,你将在刚连接的浏览器客户端中接收到推送消息

  1. 测试实时消息通信

这里采用callback回调的方式,可灵活的嵌入逻辑,只需要把SwooleCallback.php 文件放到vendor外的任何地方,通过修改命名空间来访问,这里仅把SwooleCallback.php文件当作测试回调文件!

客户端发送消息格式如下:

---敲黑板---

a.发送的消息必须为字符串

b.格式说明

namespace 为回调文件的名字空间

function 为回调文件内的方法,必须为静态方法

params 为方法的参数

正确的话,socket客户端将立即收到服务端返回的消息


All versions of swoole-websocket with dependencies

PHP Build Version
Package Version
Requires curl/curl Version >=1.8
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 xiaochengfu/swoole-websocket contains the following files

Loading the files please wait ....