-
sernick
hey, i've been wanting to play around with writing server components, but i've got a few questions? do i understand it correctly, all stanzas unhandled by the server would get routed to the component?
-
MattJ
It's typically based on addressing
-
MattJ
So on the server you assign a domain (usually a subdomain) to a component
-
MattJ
And the server will forward anything addressed to that domain to the component
-
MattJ
So if you set up a WhatsApp bridge on your server at example.com, you could configure the server to give the component the domain "whatsapp.example.com", and then someone could send a message to "+12025550162@whatsapp.example.com" and your component would receive it, and could also send back any replies to the original user from the same address
-
sernick
oohhhh
-
sernick
thanks for the writeup!
-
sernick
speaking of that whatsapp example, bridges like that would be tackled with the gateway interaction xep?
-
MattJ
sernick, in practice many implementations don't bother with that these days. It's hard to make a generic-but-nice UI on top of bridges. But yeah, it's useful to have handy, especially the address translation part. But don't assume that it's necessary.
-
MattJ
That XEP is mostly just informational, because the details of every remote platform will be slightly different. In particular most of the auth stuff there would probably happen via an OAuth flow or equivalent for many integrations today.
-
qy
https://xmpp.org/extensions/xep-0100.html interesting. Is this used for any modern chat
-
MattJ
qy, cheogram.com implements the addressing flow, which theoretically allows clients to accept phone numbers and convert them to valid JIDs
-
MattJ
I'm not sure if it implements any of the others, they're mostly using ad-hoc commands I think. Biboumi being another more modern gateway that is also ad-hoc based for configuration.