Constants · In depth

SOCKET_OPTIONS

Default WebSocket server options used by BaseSocketServer.

Explain it like I’m five

The simple mental model

SOCKET_OPTIONS is the default settings card Redweb starts from before applying the socket choices you provide.

When it fits

When should I use it?

Read it to understand defaults or build tooling that presents Redweb configuration, but pass explicit options for production decisions.

A practical API pattern

Follow the example

This pattern explains the named API. Application classes, credentials, and assets may need to be supplied; use a complete recipe for a runnable starting point.

Read this article as Markdown

JavaScript
const { SOCKET_OPTIONS } = require('redweb')
// { port: 3000, ssl: null, listen: true, routes: [] }
  1. 1

    Redweb begins with immutable documented defaults.

  2. 2

    User configuration overrides only the supplied fields.

  3. 3

    The normalized result is used consistently when the socket server starts.

Surface area

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).