mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-17 20:54:52 +08:00
add custom ws response headers
This commit is contained in:
parent
c86c6f493c
commit
3abd531980
@ -21,7 +21,7 @@
|
||||
"jelix/version": "^2.0",
|
||||
"koriym/attributes": "^1.0",
|
||||
"nunomaduro/collision": "^6.3",
|
||||
"onebot/libonebot": "^0.5",
|
||||
"onebot/libonebot": "^0.5.7",
|
||||
"php-di/php-di": "^7",
|
||||
"psr/container": "^2.0",
|
||||
"psr/simple-cache": "^3.0",
|
||||
|
||||
@ -299,6 +299,8 @@ class OneBot12Adapter extends ZMPlugin
|
||||
}
|
||||
}
|
||||
logger()->info('OneBot 12 反向 WS 连接鉴权成功,接入成功[' . $event->getFd() . ']');
|
||||
// 接入 onebots 等实现需要回传 Sec-WebSocket-Protocol 头
|
||||
$event->withResponse(HttpFactory::createResponse(101, headers: ['Sec-WebSocket-Protocol' => $event->getRequest()->getHeaderLine('Sec-WebSocket-Protocol')]));
|
||||
}
|
||||
// 设置 OneBot 相关的东西
|
||||
ConnectionUtil::setConnection($event->getFd(), $info ?? []);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user