gonzakpo/websocket-bundle
gonzakpo/websocket-bundle is a WebSocket package for Laravel/PHP projects, offering tools to establish WebSocket connections, handle real-time messaging, and add live updates to your application. It aims to simplify WebSocket integration with a bundle-style setup and straightforward configuration.
php artisan vendor:publish --provider="Vendor\Package\ServiceProvider" --tag="config"
.env (matching the v2.1 release defaults):
MEMCACHE_SERVER=127.0.0.1
MEMCACHE_PORT=11211
SESSION_PREFIX=sess_
SESSION_EXPIRE=86400
sess_<session_id> appears in memcached (telnet 127.0.0.1 11211 then get sess_...).config/session.php, set 'driver' => 'memcached' (or the driver name provided by the package). Point the package’s memcache_server / memcache_port config to your memcached cluster.SESSION_PREFIX to namespace sessions per environment (e.g. staging_sess_, prod_sess_) so multiple apps can share a memcached pool without collisions.SESSION_EXPIRE to match Laravel’s session.lifetime (in seconds). The package uses this value when writing to memcached. For long‑lived “remember me” sessions, consider a higher value or a separate prefix.Cache::store('memcached') to store frequently accessed client records. Reuse the same memcache_server/memcache_port config.memcache_server (comma‑separated if supported by the package). Use consistent hashing (default in most PHP memcached clients) to distribute keys.phpunit.xml, set SESSION_DRIVER=array or mock the memcached client to avoid hitting a real server during tests.ext-memcached is installed and enabled. The package will not work with the older memcache extension.Memcached::getStats() in a scheduled command to alert on downtime.sess_ prefix is common. Always override it in shared environments. Keys are not namespaced by Laravel automatically beyond this prefix.SESSION_EXPIRE must be less than or equal to the memcached server’s -I (max item size) and -m (memory) limits. If sessions expire too early, check both the package config and Laravel’s session.lifetime..env values, run php artisan config:clear (or config:cache in production). The package reads config at boot, so stale caches cause confusing behaviour.php -d memcached.debug=1) or use telnet to verify keys. The package does not provide a debug mode, so inspect raw memcached contents.Memcached instance in the container. You can override it via a service provider to set custom options (e.g. Memcached::OPT_COMPRESSION, timeouts) without forking the package.How can I help you explore Laravel packages today?