socket.io-website
socket.io-website copied to clipboard
docs: clarify server.on() and server.emit() are aliases for the main namespace
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 toio.of("/").on() - Added alias note to
server.emit()clarifying it maps toio.of("/").emit()
Related
Fixes socketio/socket.io#4608
@tech00exploere is attempting to deploy a commit to the SocketIO Team on Vercel.
A member of the Team first needs to authorize it.