承接 carnage/ratchet-json-server 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

carnage/ratchet-json-server

最新稳定版本:0.1.0

Composer 安装命令:

composer require carnage/ratchet-json-server

包简介

README 文档

README

An extension for ratchet enabling communication via json serialised strings

Wrapped by Ratchet's Websocket Server, Wraps your app.

Will automatically serialise and unserialise json into php arrays and back again

Install:

composer require carnage/ratchet-json-server ~0.1

Usage:

<?php
// Your shell script
use Ratchet\WebSocket\WsServer;
use Ratchet\Http\HttpServer;
use Ratchet\Server\IoServer;
use Carnage\JsonServer\JsonServer;

$ws = new WsServer(new JsonServer(new MyChat));
$ws->disableVersion(0); // old, bad, protocol version

// Make sure you're running this as root
$server = IoServer::factory(new HttpServer($ws));
$server->run();

MyChat can now send arrays of data using $conn->send(['name' => 'Fred', 'message' => 'hi']); and have them automatically json serialised. Json strings coming in from your client will be deserialised and presented to the onMessage method of MyChat as an array.

统计信息

  • 总下载量: 61
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-05-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固