How do I make request to prosody at 5280?

I tried doing this from Get the list of rooms - #52 by tmaass

and then on my server I tried to curl it but all I get is 404 Not found.
this is my command

curl 'http://localhost:5280/room-size?room=test&domain=<my domain>' -i

Is Prosody actually listening on that port?
What does the command netstat -anlp | grep 5280 return?

Also, do any other requests work? Like all-rooms or sessions?

netstat shows this

tcp        0      0 0.0.0.0:5280            0.0.0.0:*               LISTEN      -
tcp6       0      0 :::5280                 :::*                    LISTEN      -

Other requests are the same, it results in 404 Not found

I assume you’ve properly added this module to modules_enabled in your prosody cfg?

1 Like

i checked /etc/prosody/conf.avail and those modules were not enabled. I found a ping module enabled but I can’t trigger it. My domain is albert..com and on the config file it says

Component “internal.auth.albert.[hostname].com” “muc”
storage = “memory”
modules_enabled = {
“ping”;
}
admins = { "focus@auth.albert..com ", "jvb@auth.albert.[hostname].com " }
muc_room_locking = false
muc_room_default_public_jids = true

I tried http://localhost:5280/ping and it still wont work. I really have no idea how prosody works.

I have no experience with this module but from what I understand you need to setup a thingy called luajwt and another thingy called luarocks if you don’t have this working the module won’t run at all. It’s said so in this thread, someone managed to eradicate from the code the jwt part but did not give a working version.
In this thread you will see that someone solved it by using a monitoring tool called grafana that could be a better fit for you.

Let me add some additional context:

luajwtjitsi isn’t required for this particular Prosody module unless you include module:require "token/util".new(module); - and you may not even need this.

token/util requires luajwtjitsi, cjson and basexx.

net-url is only required if your module is going to parse a URL’s query string parameters as script input/arguments (ie neturl.parseQuery) You should not blindly assume you need this either (when you copy and paste). I have seen some get stuck getting this installed/working but not actually need it.

luarocks (a lua package manager) may or may not be needed, depending on what the script does. For example, if you need to include net-url you will often need to install and/or build it on your system. That library by itself may have other dependencies. You would need the lua development resources in liblua5.2-dev. See this post for some references.

I have seen many people here work too hard to get a simple room list with active participants. 100% of this data, including who is muted or running video, is in Prosody and every bit of it can be retrieved using a custom lua script. Nearly everything you need has been shared a few times - however there isn’t a thread (yet) that wraps it in a package with a bow :gift: - - maybe I should write one?

A guide would definitely help everyone. Thanks

you have thrown the gantlet… here it is.
However I will not make a bow since this is utterly hideous code. I had 2 hours and it’s enough for now.
mod_muc_status.lua.txt (9.7 KB)