Live data from Hacker News

Modern messaging: Running your own XMPP server

codedge.de

31–40 of 156 posts

Re: Modern messaging: Running your own XMPP server

#31
post #17

One potential issue with XMPP is the default port is commonly blocked on public wifi. There is an nginx-xmpp to proxy it, but it is archived. https://github.com/robn/nginx-xmpp For that reason http based protocol just seems much easier on the network or something that can be easily reverse proxied without extensions will be easier to self-host and have wilder internet connection accessibility.

[deleted]

Re: Modern messaging: Running your own XMPP server

#32
post #18
post #9

Any idea what kind of server we’d need to handle 40M users if it’s just text chat (no files or audio)?

Here's a blog post on scalability from the front page (well, sort of, see last paragraph): https://www.process-one.net/blog/ejabberd-massive-scalabilit... This includes not just textual claims about scalability but a lot of hooks you can use to followup on, like a reference to the Tsung benchmarking tool you can use. If you're asking about this for serious reasons, at this scale you're obviously running your own test…

Thanks, I've forwarded it to their chat channel.

Re: Modern messaging: Running your own XMPP server

#33

Earlier quoted context omitted.

You're thinking of outbound port limits. Inbound connections all come in on the same port and there's no port-related limits there. The real limits are going to be on hardware. If we want 40M concurrent connections, the server will need a few hundred to a few thousand gigabytes of memory.

Unless you're doing multicast or anycast, there's a port bound IP handshake that happens. You have your listener (your server port) and the connected TCP/IP client (client port, on the server machine). You're limited to 64533 clients (0-65535 but the first 1000 are reserved). If there's a way to get more client on a single machine, I'm all ears - but that's baked into IP protocol. TCP/UDP doesn't matter. It's a limit…

The uniqueness tuple for IP is (source IP, source port, dest IP, dest port). You're limited to 65,535 connections from the same two IPs on the same port, but that's not relevant to XMPP which uses only one and some transient things for file transfer and such. At worst having that many people behind one NAT will be a problem... which at this scale could be an actual problem, but there are still solutions (multiple ports being the easiest, and the fact this cluster will probably be on multiple public IPs anyhow).

See https://ats1999.github.io/blog/65535/ or similar pages.

Re: Modern messaging: Running your own XMPP server

#34
post #17

One potential issue with XMPP is the default port is commonly blocked on public wifi. There is an nginx-xmpp to proxy it, but it is archived. https://github.com/robn/nginx-xmpp For that reason http based protocol just seems much easier on the network or something that can be easily reverse proxied without extensions will be easier to self-host and have wilder internet connection accessibility.

At least Prosody implements BOSH (xmpp over http) and communication over Websocket. https://prosody.im/doc/setting_up_bosh https://prosody.im/doc/modules/mod_websocket But I never tried it myself and from a quick search the popular non-browser XMPP apps/clients don't seem to use it.

[deleted]

Re: Modern messaging: Running your own XMPP server

#35

Earlier quoted context omitted.

40M users don’t all simultaneously send messages, or does XMPP need to sustain an open connection to each user?

Yes, you need to have open connection to receive messages.

Or push notification support (which is the same, but basically the OS (Android/iOS) is the thing holding an open connection :) )

Re: Modern messaging: Running your own XMPP server

#36
post #25

Does anyone use ejabberd inside a wireguard network? I'm hoping to set it up on the main server, and connect to it with aTalk on Android - but I'm worried ssl is going to be a pain if it's not exposed with a proper domain name. I don't know if aTalk will accept a self-signed certificate (or even better, just use non-ssl with an address and port without a domain name)?

ejabberd should work fine, it won't care. But you're right - whether apps will allow you to accept self-signed certificates can vary. Some are strict and don't allow bypass, others may just issue a warning prompt that you can dismiss. I haven't personally tried aTalk.

Re: Modern messaging: Running your own XMPP server

#37
post #9

Any idea what kind of server we’d need to handle 40M users if it’s just text chat (no files or audio)?

> Any idea what kind of server we’d need to handle 40M users if it’s just text chat (no files or audio)?

IRC.

Spin up multiple VM/Docker/whatever instances with an IRCd daemon, add each IRCd as a leaf.

Re: Modern messaging: Running your own XMPP server

#38
post #25

Does anyone use ejabberd inside a wireguard network? I'm hoping to set it up on the main server, and connect to it with aTalk on Android - but I'm worried ssl is going to be a pain if it's not exposed with a proper domain name. I don't know if aTalk will accept a self-signed certificate (or even better, just use non-ssl with an address and port without a domain name)?

I was thinking of setting something like this up on a Tailscale network, and figured I'd just get real certs for the servers in question using DNS challenges, which I've been able to do with my tailnet (driven by Headscale) for a while now. But even if not, if your root cert is in your device's trust store, then an app would have to go out of its way to only trust well known CAs.

Re: Modern messaging: Running your own XMPP server

#39
post #17

One potential issue with XMPP is the default port is commonly blocked on public wifi. There is an nginx-xmpp to proxy it, but it is archived. https://github.com/robn/nginx-xmpp For that reason http based protocol just seems much easier on the network or something that can be easily reverse proxied without extensions will be easier to self-host and have wilder internet connection accessibility.

At least Prosody implements BOSH (xmpp over http) and communication over Websocket. https://prosody.im/doc/setting_up_bosh https://prosody.im/doc/modules/mod_websocket But I never tried it myself and from a quick search the popular non-browser XMPP apps/clients don't seem to use it.

with chat control on the horizon, they should probably consider implementing it

Re: Modern messaging: Running your own XMPP server

#40
post #26

If you plan to communicate with people not in the techsphere, Signal is probably the best bet to convince people to switch to.

Signal is a walled garden and might even leave the EU soon. Of course if that happens, XMPP clients will also be harder to get, but at least I will always have full control over my XMPP server.
Post reply on HN