workbunny / webman-push-server Goto Github PK
View Code? Open in Web Editor NEW🚀🐇 Webman plugin for push server implementation.
Home Page: https://www.workerman.net/plugin/102
License: MIT License
🚀🐇 Webman plugin for push server implementation.
Home Page: https://www.workerman.net/plugin/102
License: MIT License
push.js是不是需要付费啊?免费版有限制吗?
新创建的webman项目,引入webman-push-server,出现错误,composer update 也无效
php 版本8.1
❯ php --ri redis
redis
Redis Support => enabled
Redis Version => 5.3.7
Redis Sentinel Version => 0.1
Available serializers => php, json
composer.json
{
"name": "workerman/webman",
"type": "project",
"keywords": [
"high performance",
"http service"
],
"homepage": "https://www.workerman.net",
"license": "MIT",
"description": "High performance HTTP Service Framework.",
"authors": [
{
"name": "walkor",
"email": "[email protected]",
"homepage": "https://www.workerman.net",
"role": "Developer"
}
],
"support": {
"email": "[email protected]",
"issues": "https://github.com/walkor/webman/issues",
"forum": "https://wenda.workerman.net/",
"wiki": "https://workerman.net/doc/webman",
"source": "https://github.com/walkor/webman"
},
"require": {
"php": ">=7.2",
"workerman/webman-framework": "^1.5.0",
"monolog/monolog": "^2.0",
"workbunny/webman-push-server": "^1.2"
},
"suggest": {
"ext-event": "For better performance. "
},
"autoload": {
"psr-4": {
"": "./",
"app\\": "./app",
"App\\": "./app",
"app\\View\\Components\\": "./app/view/components"
},
"files": [
"./support/helpers.php"
]
},
"scripts": {
"post-package-install": [
"support\\Plugin::install"
],
"post-package-update": [
"support\\Plugin::install"
],
"pre-package-uninstall": [
"support\\Plugin::uninstall"
]
}
}
1,前端无法订阅私有连接,报错:Received invalid JSON workbunny:d1b1a8016284207d7ca17c3f793c4aee24b75e78103f51108e2af2ec953f5120
2,push.Js接受的消息,没有判断到底是不是json就直接当做json解析
3,server后台,获取query参数的时候没有判断是否存在这个参数
4,api后台,无法使用报错:auth_key should be a valid app key
5,api更换委官方api,报错:"error":"Invalid auth_key",修改API.PHP的$this->_settings['base_path'] = '/apps/1‘后报错:{"error":"Invalid signature"}
在服务端发布消息到客户端时,触发hook8002/apps/1/events?auth_key=workbunny&auth_timestamp=1670557139&auth_version=1.0&body_md5=815333cb3a7449 df17f843564824d1e4&auth_signature=195d9d8f622705fede774658622c75d2e4a95e6fb02e951a703174f2168bc98b"
抛出的异常
代码示例:
try {
$pusher = new ApiClient(
'workbunny',
'U2FsdGVkX1+vlfFH8Q9XdZ9t9h2bABGYAZltEYAX6UM=',
'1',
['host'=>"0.0.0.0:8002",'scheme'=>'http']
);
$pusher->trigger(
"private-d",
"client-a",
"23423432"
);
} catch (GuzzleException|ApiErrorException|PusherException $e) {
dump($e);
}
目前环境:
PHP 8.1.27
composer 2.6.6
composer.json信息:
{
"name": "workerman/webman",
"type": "project",
"keywords": [
"high performance",
"http service"
],
"homepage": "https://www.workerman.net",
"license": "MIT",
"description": "High performance HTTP Service Framework.",
"authors": [
{
"name": "walkor",
"email": "[email protected]",
"homepage": "https://www.workerman.net",
"role": "Developer"
}
],
"support": {
"email": "[email protected]",
"issues": "https://github.com/walkor/webman/issues",
"forum": "https://wenda.workerman.net/",
"wiki": "https://workerman.net/doc/webman",
"source": "https://github.com/walkor/webman"
},
"require": {
"php": ">=7.2",
"workerman/webman-framework": "^1.5.0",
"monolog/monolog": "^2.0",
"workbunny/webman-push-server": "1.2.1",
"workerman/http-client" : "^1.0"
},
"suggest": {
"ext-event": "For better performance. "
},
"autoload": {
"psr-4": {
"": "./",
"app\": "./app",
"App\": "./app",
"app\View\Components\": "./app/view/components"
},
"files": [
"./support/helpers.php"
]
},
"scripts": {
"post-package-install": [
"support\Plugin::install"
],
"post-package-update": [
"support\Plugin::install"
],
"pre-package-uninstall": [
"support\Plugin::uninstall"
]
}
}
我这是拉的一个新webman项目
client
链接私有频道订阅同一个事件,无法通信
(原因正在排查)。HookServer::publish('client-a', ["a" => 1]);
客户端无法收到消息。TypeError: Argument 1 passed to Workbunny\WebmanPushServer\Events\AbstractEvent::exists() must be of the type string, null given, called in /var/www/fj-oh/vendor/workbunny/webman-push-server/src/Events/AbstractEvent.php on line 70 a
nd defined in /var/www/fj-oh/vendor/workbunny/webman-push-server/src/Events/AbstractEvent.php:96
public static function factory(string $event): ?AbstractEvent
{
if(self::exists($preEvent = self::pre($event))){
return self::$_eventObj[$preEvent] ?? (self::$_eventObj[$preEvent] = new self::$_events[$preEvent]($event));
}
return null;
}
当客户端监听和发布事件未包含pusher:
,pusher_internal:
时需要异常处理
ErrorException: Array to string conversion in /Users/chen/developer/webman-chat/vendor/workbunny/webman-push-server/src/HookServer.php:180
Stack trace:
#0 [internal function]: {closure}(2, 'Array to string...', '/Users/chen/dev...', 180)
#1 /Users/chen/developer/webman-chat/vendor/workbunny/webman-push-server/src/HookServer.php(180): Redis->xack('workbunny:webma...', 'workbunny:webma...', Array)
这是报错时打印出来的数据
string(43) "workbunny:webman-push-server:webhook-stream"
string(60) "workbunny:webman-push-server:webhook-stream:event-hook-group"
array(1) {
[1]=>
array(1) {
[0]=>
string(15) "1706934636800-0"
}
}
用的pusher-js做客户端退订时没有提交channel_data数据会报错
描述:
计划:
如题支持群组或者分组群聊吗?
Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 398462976 bytes) in D:\kok\yuanwebman\webman\vendor\workbunny\webman-push-server\src\WebhookHandler.php on line 43
Worker process terminated with ERROR: E_ERROR "Allowed memory size of 1073741824 bytes exhausted (tried to allocate 398462976 bytes) in D:\kok\yuanwebman\webman\vendor\workbunny\webman-push-server\src\WebhookHandler.php on line 43"
process D:\kok\yuanwebman\webman\runtime\windows\start_plugin.workbunny.webman-push-server.hook-server.php terminated and try to restart
plugin.workbunny.webman-push-server.hook-server none 1 [ok]
Client客户端存在一定问题,无法使用,暂时只能用ApiClient代替
Argument 1 passed to Workbunny\WebmanPushServer\Server::_getConnectionProperty() must be an instance of Workerman\Connection\TcpConnection, array, called in /var/www/fj-oh/vendor/workbunny/webman-push
-server/src/Server.php on line 442 and defined in /var/www/fj-oh/vendor/workbunny/webman-push-server/src/Server.php:327
HookServer.php下面使用sqlite数据库链接使用方法找不到static::$app变量。Schema::connection
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.