Replies: 2 comments
-
I made it work by
'callbacks' => [
Event::ON_REQUEST => ['HttpServer', 'onRequest'],
Event::ON_HAND_SHAKE => [MyWebsocketKernel::class, 'onHandShake'],
Event::ON_MESSAGE => [MyWebsocketKernel::class, 'onMessage'],
Event::ON_CLOSE => [MyWebsocketKernel::class, 'onClose'],
],
// dependencies.php
return [
'HttpServer' => App\Http\MyHttpKernel::class,
Hyperf\HttpServer\CoreMiddleware::class => App\Http\Middleware\MyCoreMiddleware::class,
Hyperf\WebSocketServer\CoreMiddleware::class => App\Http\Middleware\MyWebSocketCoreMiddleware::class,
]; |
Beta Was this translation helpful? Give feedback.
0 replies
-
Related |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Content
✅ Swoole supports Hybrid WebSocket+HTTP Server
Swoole\WebSocket\Server
extendsSwoole\Http\Server
and can receiveonRequest
✅ Hyperf supports Hybrid WebSocket+HTTP Server
❌ Hypervel loses hybrid server capability?
components/src/foundation/src/Providers/FoundationServiceProvider.php
Line 138 in 12e5145
Can we please support Hybrid WebSocket+HTTP Server in Hyperf 🙏
In my specific case: I need custom CoreMiddleware (override in config/dependencies.php) but only one Kernerl/WebSocketKernel's middleware is used.
Beta Was this translation helpful? Give feedback.
All reactions