File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ A simple echo server:
77``` php
88use Ratchet\RFC6455\Messaging\Message;
99use React\EventLoop\Factory;
10- use React\Http\MiddlewareRunner;
1110use React\Http\Server;
1211use Voryx\WebSocketMiddleware\WebSocketConnection;
1312use Voryx\WebSocketMiddleware\WebSocketMiddleware;
@@ -28,3 +27,16 @@ $server->listen(new \React\Socket\Server('127.0.0.1:4321', $loop));
2827
2928$loop->run();
3029```
30+ # Options
31+ By default ` WebSocketMiddleware ` uses the ` ratchet/rfc6455 ` default max sizes for messages and frames and also disables compression.
32+ These settings can be overridden with the ` WebSocketOptions ` object.
33+ ``` php
34+ $ws = new WebSocketMiddleware(
35+ [],
36+ $connectionHandler,
37+ [],
38+ WebSocketOptions::getDefault()
39+ ->withMaxFramePayloadSize(2048)
40+ ->withMaxMessagePayloadSize(4096)
41+ ->withPermessageDeflate());
42+ ```
You can’t perform that action at this time.
0 commit comments