socket.io-website icon indicating copy to clipboard operation
socket.io-website copied to clipboard

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

Open tech00exploere opened this issue 5 months ago • 1 comments

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

tech00exploere avatar Jun 11 '26 09:06 tech00exploere

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

A member of the Team first needs to authorize it.

vercel[bot] avatar Jun 11 '26 09:06 vercel[bot]