SOCKET_OPTIONS
Documentation for Redweb 0.13.0. Install that exact version when following these examples.
Default WebSocket server options used by BaseSocketServer.
Explain it like I’m five
SOCKET_OPTIONS is the default settings card Redweb starts from before applying the socket choices you provide.
When should I use it?
Read it to understand defaults or build tooling that presents Redweb configuration, but pass explicit options for production decisions.
Follow the example
This API pattern illustrates the named surface; it may require application-owned classes, credentials, or assets. Start from a complete recipe for a runnable application.
const { SOCKET_OPTIONS } = require('redweb')
// { port: 3000, ssl: null, listen: true, routes: [] }- Redweb begins with immutable documented defaults.
- User configuration overrides only the supplied fields.
- The normalized result is used consistently when the socket server starts.
Methods and members
port
Default WebSocket port (3000).
ssl
Default TLS config (null).
listen
Owned socket servers listen by default. Supplied servers remain caller-owned unless listen is explicitly true.
routes
Routes array default (empty; a DefaultRoute is created when none are provided).
What should I watch for?
Treat exported defaults as documentation, not mutable global configuration. Never change the object to configure one server.