socketio / socketio/socket.io

Ability to get all namespaces

Open
#3,911 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
63.2k
Forks
10.3k
Avg merge
11d 20h
Merged PRs (30d)
2

Description

Is your feature request related to a problem? Please describe.

I'm using socket.io-prometheus-metrics to report metrics about sockets to Prometheus and it works great with SocketIO 1/2, but not not with 3/4 due to the change in variable name for _nsps.

Describe the solution you'd like

Could we get an API method added to the server which will give a list of all namespaces available - something like:

public namespaces() {
  return Object.keys(this._nsps);
}

Describe alternatives you've considered

I've got a typing hack in locally at the moment to workaround it.

Additional context

N/A

Thanks! Wonderful to see Socket.IO moving forwards again.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the server API and its _nsps usage, along with the related TypeScript declarations. Confirm how namespaces are represented and exposed before checking that the proposed public API returns every available namespace and that the corresponding types are usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.