Skip to content

docs: clarify server.on() and server.emit() are aliases for the main namespace#542

Open
tech00exploere wants to merge 1 commit into
socketio:mainfrom
tech00exploere:fix/server-api-main-namespace-aliases
Open

docs: clarify server.on() and server.emit() are aliases for the main namespace#542
tech00exploere wants to merge 1 commit into
socketio:mainfrom
tech00exploere:fix/server-api-main-namespace-aliases

Conversation

@tech00exploere

Copy link
Copy Markdown

Description

The Server API docs showed examples of io.on() and io.emit() but never explained
that these are aliases for the main namespace (/), which was confusing for new users.

Other methods like server.use(), server.fetchSockets(), and server.disconnectSockets()
already had "Alias for io.of("/")..." notes — this PR makes server.on() and
server.emit() consistent with that pattern.

Changes

  • Added alias note to server.on() clarifying it maps to io.of("/").on()
  • Added alias note to server.emit() clarifying it maps to io.of("/").emit()

Related

Fixes socketio/socket.io#4608

@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

@tech00exploere is attempting to deploy a commit to the SocketIO Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: Document io.on, io.use etc in the Server API docs

1 participant