mirror of
https://github.com/Yonle/bostr.git
synced 2025-04-09 04:18:08 +02:00
There you go, The currently connected user numbers
Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
parent
181840d045
commit
a9f6f79f49
4
http.js
4
http.js
@ -12,6 +12,8 @@ const log = _ => console.log(process.pid, curD(), "-", _);
|
||||
const server = http.createServer()
|
||||
const wss = new WebSocket.WebSocketServer({ noServer: true });
|
||||
|
||||
let maxsocks = 0;
|
||||
|
||||
server.on('request', (req, res) => {
|
||||
log(`${req.headers["x-forwarded-for"]?.split(",")[0] || req.socket.address()?.address} - ${req.method} ${req.url}`)
|
||||
|
||||
@ -25,6 +27,8 @@ server.on('request', (req, res) => {
|
||||
config.relays.forEach(_ => {
|
||||
res.write("- " + _ + "\n");
|
||||
});
|
||||
|
||||
res.write(`\nI have ${wss.clients.size} users currently connected to this bouncer.\n`);
|
||||
res.write(`\nConnect to this bouncer with nostr client: ws://${req.headers.host} or wss://${req.headers.host}\n\n---\n`);
|
||||
res.end("Powered by Bostr - Open source nostr Bouncer\nhttps://github.com/Yonle/bostr");
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user