-
jjj333_p (any pronouns)
> Is port 5281 open on your server? At a glance it looks like it timed out while trying to connect uhhh lets check ↺
-
jjj333_p (any pronouns)
no it is not (is it supposed to be?)
-
moparisthebest
If you want to connect to it yes
-
jjj333_p (any pronouns)
heres my ufw output, i forgot how to know which port is which componet https://pastebin.mozilla.org/jLXi1i1s
-
jjj333_p (any pronouns)
> If you want to connect to it yes well i got that much, but like which port is xmpp supposed to be served on? ↺
-
jjj333_p (any pronouns)
i figure all clients are supposed to guess at the same port, no?
-
moparisthebest
Nope, that's what discovery is for
-
jjj333_p (any pronouns)
oh boy!
-
moparisthebest
You can use any ports you want, just need to have srv records or host-meta files pointing clients to the right place
-
jjj333_p (any pronouns)
(i have neither as i was told it was fine given all my domain and subdomain is on one ip, but i plan to add srv records soon and try to use direct tls)
-
moparisthebest
5222 is the standard c2s port and 5269 s2s, you don't need srv records if that's all you want
-
moparisthebest
But no websockets or direct TLS that way
-
jjj333_p (any pronouns)
yeah that makes sense. im planning to try to set up having caddy rev proxy tcp off port 443 so i can just have it manage tls and get that direct tls
-
jjj333_p (any pronouns)
okay im now (much quicker so not a timeout) getting the error > [Symbol(kMessage)]: 'write EPROTO 406839047B7F0000:error:0A0000C6:SSL routines:tls_get_more_records:packet length too long:ssl/record/methods/tls_common.c:654:\n'
-
learning xmpp
Hello guys
-
moparisthebest
jjj333_p (any pronouns): my guess is that port is http not https
-
cal0pteryx
Thilo Molitor: not yet, but there is a MR for it
-
jjj333_p (any pronouns)
> jjj333_p (any pronouns): my guess is that port is http not https its accessing `wss://` not `https://` ↺
-
Menel
jjj333_p (any pronouns): what exactly are you even trying to do? It seems I didn't see the beginning of the discussion and the explaination of the setup and goal. But somehow websocket and port 5269 are floating around here and that doesn't fit at all together.
-
jjj333_p (any pronouns)
get the sample code of this nodejs library for xmpp to work with my server https://www.npmjs.com/package/stanza
-
jjj333_p (any pronouns)
https://downloadable.pain.agency/file_share/lgdpQpM9GWAYFOgrirNWJ_wb/0b2c3555-6e63-4923-91d3-9e137fb99047.png
-
Menel
Seems that is a bosh or websocket client. Do you need your xmpp server serve that.
-
jjj333_p (any pronouns)
> Seems that is a bosh or websocket client. maybe? its supposedly designed for the browser
-
jjj333_p (any pronouns)
my https domain (where files go) is downloadable.pain.agency should i try put that as the websocket domain?
-
Menel
c2s and s2s ports don't matter for that. Your xmpp server software will have documentation about that. You don't need any records beside your A record as dns. And you'll be able to hardcode the port and path in your software most likely
-
Menel
jjj333_p (any pronouns): no, your websocket address is not the same as some download path
-
Menel
What's your server software?
-
jjj333_p (any pronouns)
> jjj333_p (any pronouns): no, your websocket address is not the same as some download path okay. im probably being stupid about it ↺
-
jjj333_p (any pronouns)
> What's your server software? postgres ↺
-
jjj333_p (any pronouns)
nope
-
jjj333_p (any pronouns)
prosody
-
jjj333_p (any pronouns)
postgres is closer than portugese which is what i almost said
-
jjj333_p (any pronouns)
its late 😅
-
Menel
See https://prosody.im/doc/modules/mod_websocket
-
Menel
example.com:5281/xmpp-websocket✎ -
Menel
wss://example.com:5281/xmpp-websocket ✏
-
Menel
(assuming no reverse proxy (✎ -
Menel
(assuming no reverse proxy) ✏
-
jjj333_p (any pronouns)
> (assuming no reverse proxy) caddy is only proxying downloadable.pain.agency ↺
-
Menel
Good
-
jjj333_p (any pronouns)
(though i may end up trying to get caddy to rev proxy the tcp as well, so i can use direct tls, thatll be fun to add to the mix)✎ -
jjj333_p (any pronouns)
(though i may end up trying to get caddy to rev proxy the tcp as well, so i can use direct tls, thatll be fun to add to the mix, not for now though) ✏
-
Menel
Then use the above address. And use your virtualhost for example.com Bedt put that in your Webbrowser. If working you'll see a prosody success message, stating you're at your websocket path✎ -
Menel
Then use the above address. And use your virtualhost for example.com Best put that in your Webbrowser. (https protocol, not was in that case) If working you'll see a prosody success message, stating you're at your websocket path ✏
-
Menel
Then use the above address. And use your virtualhost for example.com Best put that in your Webbrowser. (https protocol, not wss in that case) If working you'll see a prosody success message, stating you're at your websocket path ✏
-
jjj333_p (any pronouns)
> See https://prosody.im/doc/modules/mod_websocket i do have websocket and bosch both enabled ↺
-
jjj333_p (any pronouns)
> Then use the above address. And use your virtualhost for example.com > Best put that in your Webbrowser. (https protocol, not wss in that case) > If working you'll see a prosody success message, stating you're at your websocket path oh huh i get the same error as with the code 🤔 ↺
-
jjj333_p (any pronouns)
> An error occurred during a connection to pain.agency:5222. SSL received a record that exceeded the maximum permissible length.
-
jjj333_p (any pronouns)
it seems to be an issue with my server
-
jjj333_p (any pronouns)
if i try putting it to http i get the following output on screen ```xml <?xml version='1.0'?><stream:stream xmlns:stream='http://etherx.jabber.org/streams' id='' xml:lang='en' xmlns='jabber:client'><stream:error><not-well-formed xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error></stream:stream> ```
-
Menel
jjj333_p (any pronouns): why port 5222?
-
Menel
Prosody uses websocket at 5281 by default
-
jjj333_p (any pronouns)
thats what i was told the default is and that is what i have open in my firewall
-
jjj333_p (any pronouns)
ah i see
-
jjj333_p (any pronouns)
i need to allow 5281 probably
-
Menel
No, as I said in my first messages. It's all a mess here. Thsts why I wanted to know what you're even doing. Because it was such a random discussion
-
Menel
5222 is the default xmpp client port. But you're using a web client that doesn't speak raw xmpp but http or websocket. And both of that will be a Webserver thing. And the prosody Webserver is on 5281 for https/wss by default
-
jjj333_p (any pronouns)
i am using stanza.js
-
jjj333_p (any pronouns)
which like you said probably does only support websocket✎ -
jjj333_p (any pronouns)
which like you said probably does only support websocket and bosch ✏
-
jjj333_p (any pronouns)
https://downloadable.pain.agency/file_share/oAdFi00QoC9FSEl_mHDipVZF/6536f126-0d99-4fb8-abeb-65e1f2bf32c7.png
-
jjj333_p (any pronouns)
here we are with this
-
jjj333_p (any pronouns)
ay it works
-
jjj333_p (any pronouns)
https://downloadable.pain.agency/file_share/vrZ2VM4xwIlGuBYUrvvn7dNj/50924342-3fb7-43d6-a05c-f443453d986e.png
-
jjj333_p (any pronouns)
lmao vscodium crashed✎ -
jjj333_p (any pronouns)
lmao vscodium crashed... catastrophically holy crap it fucked itself lmao ✏
-
jjj333_p (any pronouns)
anyways great, that seems ironed out. im currently working on another project and i should stop myself from starting a new project in the middle of another one. ill tinker in the upcomming days
-
jjj333_p (any pronouns)
thank you lots Menel
-
Menel
Yes, this works at least for the server part. https://pain.agency:5281/xmpp-websocket will be the address you'll want to hook up your js client to
-
Menel
(only replacing https with wss for the client config)
-
jjj333_p (any pronouns)
> Yes, this works at least for the server part. > https://pain.agency:5281/xmpp-websocket will be the address you'll want to hook up your js client to yes that is what i put in ↺
-
jjj333_p (any pronouns)
and it worked
-
Thilo Molitor
cal0pteryx thanks :)
-
seil
What's the best way to determine a "conversation id" for a message?
-
seil
when I send messages they have the to: field set to the recipient, and when I receive something it's my jid. Is there anything I can use more..universally? Or am I maybe misunderstanding xmpp right now
-
Zash
XMPP doesn't really have a separate concept of a "conversation"
-
seil
I kind of noticed that and made a lil converter that adds a separate conversation property to the message where its always the recipients jid (if to: me from: them, then conversation will still be them etc)
-
seil
This feels super jank/hacky though, and was wondering if there's a more solid/foolproof solution?
-
seil
I have a habit of sometimes over engineering things^
-
Zash
With one-to-one chat messages, what's wrong with the @from on incoming messages and @to on outgoing messages?
-
Zash
Depending on exactly what you think of as a "conversation", there's also the <thread> id or just using group chats for each conversation.
-
Zash
The later being how some other systems like e.g. Matrix does it.
-
Zash
> With one-to-one chat messages, what's wrong with the @from on incoming messages and @to on outgoing messages? This is what the 'with' search field in XEP-0313 does fwiw. ↺
-
Menel
In the context of groupchats and also in mam there are id's. But in real time one on one, what would they be used for?
-
seil
User can browse to their conversations like so: /app/chats/foo@seil.zip I have to do some sorting before the message is added to the message list so i can easily fetch all message content between me and foo@seil.zip
-
seil
> This is what the 'with' search field in XEP-0313 does fwiw. interesting ↺
-
Zash
Actually, it's the Bare JID, so user@host, with the /resource part stripped
-
seil
though it seems like it doesnt send a with tag back, so i cannot be sure that the messages are the same as the ones from my request, if the user receives other messages
-
seil
> Actually, it's the Bare JID, so user@host, with the /resource part stripped yes ↺
-
Zash
You'll have to check if barejid(to) == your jid or barjid(from)== your jid, and do something based on that
-
seil
> You'll have to check if barejid(to) == your jid or barjid(from)== your jid, and do something based on that that is exactly what i am doing right now :P ↺
-
seil
I guess I wasn't overengineering things then?
-
Zash
If you need the "with" or conversation counterpart id then that's the way to do it.