socketio / socket.io-admin-ui

Admin UI for Socket.IO
https://admin.socket.io
MIT License
346 stars 94 forks source link

UI not showing running socket.io server and users #42

Closed Thomas-1985 closed 2 years ago

Thomas-1985 commented 2 years ago

Hi

express: 4.17.2 socket.io: 4.4.1 @socket.io/admin-ui: 0.3.0

I have added the ui backend to my socket.io / Express backend like this

    instrument(this.socketServer, {
      auth: {
        type: "basic",
        username: "admin",
        password: "$2b$10$..."
      },
      readonly: true,
      namespaceName: "/socketui"
    });

After i booted my backend, i can login to the ui (it says "connected") but i always see 0 servers and 0 clients online.

My socket.io server requires that for every event a token (jwt) has to be sent with the token attribute, but i don't think this should block the admin ui from showing stuff.

I don't know what im doing wrong here

Best, Thomas

darrachequesne commented 2 years ago

I think that's because you forgot to include the namespace name ("/socketui") in the server URL, so you are connected to the Socket.IO server, but in the main namespace and not the admin namespace.

I have added a dedicated field in the connection modal for the namespace, in order to prevent this kind of issues: https://github.com/socketio/socket.io-admin-ui/commit/5a8a75edc0787fd4515b832e35c1868182d35d36

Please reopen if needed!