jdev - 2024-08-04


  1. 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

  2. jjj333_p (any pronouns)

    no it is not (is it supposed to be?)

  3. moparisthebest

    If you want to connect to it yes

  4. jjj333_p (any pronouns)

    heres my ufw output, i forgot how to know which port is which componet https://pastebin.mozilla.org/jLXi1i1s

  5. 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?

  6. jjj333_p (any pronouns)

    i figure all clients are supposed to guess at the same port, no?

  7. moparisthebest

    Nope, that's what discovery is for

  8. jjj333_p (any pronouns)

    oh boy!

  9. moparisthebest

    You can use any ports you want, just need to have srv records or host-meta files pointing clients to the right place

  10. 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)

  11. moparisthebest

    5222 is the standard c2s port and 5269 s2s, you don't need srv records if that's all you want

  12. moparisthebest

    But no websockets or direct TLS that way

  13. 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

  14. 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'

  15. learning xmpp

    Hello guys

  16. moparisthebest

    jjj333_p (any pronouns): my guess is that port is http not https

  17. cal0pteryx

    Thilo Molitor: not yet, but there is a MR for it

  18. jjj333_p (any pronouns)

    > jjj333_p (any pronouns): my guess is that port is http not https its accessing `wss://` not `https://`

  19. 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.

  20. 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

  21. jjj333_p (any pronouns)

    https://downloadable.pain.agency/file_share/lgdpQpM9GWAYFOgrirNWJ_wb/0b2c3555-6e63-4923-91d3-9e137fb99047.png

  22. Menel

    Seems that is a bosh or websocket client. Do you need your xmpp server serve that.

  23. jjj333_p (any pronouns)

    > Seems that is a bosh or websocket client. maybe? its supposedly designed for the browser

  24. jjj333_p (any pronouns)

    my https domain (where files go) is downloadable.pain.agency should i try put that as the websocket domain?

  25. 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

  26. Menel

    jjj333_p (any pronouns): no, your websocket address is not the same as some download path

  27. Menel

    What's your server software?

  28. 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

  29. jjj333_p (any pronouns)

    > What's your server software? postgres

  30. jjj333_p (any pronouns)

    nope

  31. jjj333_p (any pronouns)

    prosody

  32. jjj333_p (any pronouns)

    postgres is closer than portugese which is what i almost said

  33. jjj333_p (any pronouns)

    its late 😅

  34. Menel

    See https://prosody.im/doc/modules/mod_websocket

  35. Menel

    example.com:5281/xmpp-websocket

  36. Menel

    wss://example.com:5281/xmpp-websocket

  37. Menel

    (assuming no reverse proxy (

  38. Menel

    (assuming no reverse proxy)

  39. jjj333_p (any pronouns)

    > (assuming no reverse proxy) caddy is only proxying downloadable.pain.agency

  40. Menel

    Good

  41. 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)

  42. 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)

  43. 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

  44. 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

  45. 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

  46. jjj333_p (any pronouns)

    > See https://prosody.im/doc/modules/mod_websocket i do have websocket and bosch both enabled

  47. 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 🤔

  48. jjj333_p (any pronouns)

    > An error occurred during a connection to pain.agency:5222. SSL received a record that exceeded the maximum permissible length.

  49. jjj333_p (any pronouns)

    it seems to be an issue with my server

  50. 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> ```

  51. Menel

    jjj333_p (any pronouns): why port 5222?

  52. Menel

    Prosody uses websocket at 5281 by default

  53. jjj333_p (any pronouns)

    thats what i was told the default is and that is what i have open in my firewall

  54. jjj333_p (any pronouns)

    ah i see

  55. jjj333_p (any pronouns)

    i need to allow 5281 probably

  56. 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

  57. 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

  58. jjj333_p (any pronouns)

    i am using stanza.js

  59. jjj333_p (any pronouns)

    which like you said probably does only support websocket

  60. jjj333_p (any pronouns)

    which like you said probably does only support websocket and bosch

  61. jjj333_p (any pronouns)

    https://downloadable.pain.agency/file_share/oAdFi00QoC9FSEl_mHDipVZF/6536f126-0d99-4fb8-abeb-65e1f2bf32c7.png

  62. jjj333_p (any pronouns)

    here we are with this

  63. jjj333_p (any pronouns)

    ay it works

  64. jjj333_p (any pronouns)

    https://downloadable.pain.agency/file_share/vrZ2VM4xwIlGuBYUrvvn7dNj/50924342-3fb7-43d6-a05c-f443453d986e.png

  65. jjj333_p (any pronouns)

    lmao vscodium crashed

  66. jjj333_p (any pronouns)

    lmao vscodium crashed... catastrophically holy crap it fucked itself lmao

  67. 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

  68. jjj333_p (any pronouns)

    thank you lots Menel

  69. 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

  70. Menel

    (only replacing https with wss for the client config)

  71. 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

  72. jjj333_p (any pronouns)

    and it worked

  73. Thilo Molitor

    cal0pteryx thanks :)

  74. seil

    What's the best way to determine a "conversation id" for a message?

  75. 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

  76. Zash

    XMPP doesn't really have a separate concept of a "conversation"

  77. 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)

  78. seil

    This feels super jank/hacky though, and was wondering if there's a more solid/foolproof solution?

  79. seil

    I have a habit of sometimes over engineering things^

  80. Zash

    With one-to-one chat messages, what's wrong with the @from on incoming messages and @to on outgoing messages?

  81. 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.

  82. Zash

    The later being how some other systems like e.g. Matrix does it.

  83. 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.

  84. 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?

  85. 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

  86. seil

    > This is what the 'with' search field in XEP-0313 does fwiw. interesting

  87. Zash

    Actually, it's the Bare JID, so user@host, with the /resource part stripped

  88. 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

  89. seil

    > Actually, it's the Bare JID, so user@host, with the /resource part stripped yes

  90. Zash

    You'll have to check if barejid(to) == your jid or barjid(from)== your jid, and do something based on that

  91. 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

  92. seil

    I guess I wasn't overengineering things then?

  93. Zash

    If you need the "with" or conversation counterpart id then that's the way to do it.