jdev - 2020-01-14


  1. Pradeep

    Hi, I am using XMPP for intranet push notifications on mobile phones. Now I have a requirement to do intranet push notifications using XMPP on a web browser. When it comes to browser push notification, it is necessary to write client side inside "Service Worker". To keep it simple. Though my web application is not running in a browser instance, the browser should get notifications from ejabberd server and show a notification to the user.

  2. Pradeep

    Kindly let me know possible solutions.

  3. jonas’

    sorry, I don’t know web, but someone else might

  4. jonas’

    stick around for a while

  5. Pradeep

    Sure. Thanks.

  6. pep.

    Pradeep, I assume you're familiar with https://w3c.github.io/push-api/ https://developer.mozilla.org/en-US/docs/Web/API/Push_API

  7. pep.

    You can still use that in combination with https://xmpp.org/extensions/xep-0357.html

  8. pep.

    I know some have done it, though I wished it was documented

  9. pep.

    Also, "intranet"?

  10. pep.

    Unless you recompile your browsers to change the push API implementation (change the push server's url), I am not entirely sure how that works. Maybe it's configurable..

  11. Pradeep

    It looks like browser Push_API supports push services like FCM.

  12. jonas’

    you’re comfortable with sending intranet push notifications through google?

  13. Pradeep

    We cannot do intranet messaging via FCM. It has to go through cloud.

  14. Pradeep

    My scenarios is to support devices those are forced to not to be connected to internet.

  15. Pradeep

    To make it short. The network the devices(desktop, mobile phones) connected is highly secured so that there will be no network connections.

  16. jonas’

    Pradeep, but how will they then receive messages from FCM?

  17. Pradeep

    We should not use FCM

  18. Pradeep

    I am looking for a solution without thirdparty push services. Instead use XMPP for web push notification.

  19. Pradeep

    I have already achieved in web using Stophe.js on the web page. But the requirement is to establish XMPP connection in background browser service "Service Worker". Mine works only if I keep the web page alive on the browser.

  20. jonas’

    I see; not sure if that’s even possible. I don’t know much about web things, and I avoid them if possible :)

  21. pep.

    Pradeep, the web push API doesn't use FCM. It uses the browser's vendor (Mozilla, Google, etc.)

  22. Pradeep

    Ok, pep. But I don't see an option where we can define our own push service url. That's why I got bit confused.

  23. pep.

    Hence me saying you might need to recompile the browsers with your own push server url

  24. pep.

    XMPP can't control that part

  25. Zash

    about:config in Firefox has some dom.push.serverURL setting that looks relevant

  26. Zash

    set to some wss URL

  27. Zash

    No idea what it does tho

  28. pep.

    Zash, XMPP over Websockets!

  29. Pradeep

    Let me try the ways you guy suggested. Thanks pep. jonas’ & Zash

  30. Pradeep

    *guys

  31. pep.

    Try to get web push working already. I guess you can have fun reverse engineering the push server implementation later..

  32. pep.

    implementations*

  33. jonas’

    pep., clean-room reverse engineer? :>

  34. jonas’

    (I’m sorry)

  35. pep.

    Firefox and Chromium are free software :)

  36. jonas’

    the push server may not be

  37. pep.

    True. Though if it's internal use, there's probably no obligation to redistribute their changes

  38. pep.

    Now.. IANAL

  39. pep.

    Maybe we should reject 357 because it's not possible to use it for web push internally /s

  40. jonas’

    pep., I’m pretty sure that’s false.

  41. jonas’

    since everything beyond the application server (which still needs to understand XMPP) is out of scope

  42. pep.

    I can't even joke without being accurate now :(

  43. Zash

    You could have the app server send an XMPP message over some existing connection. Or SMS. Or a carrier pidgeon.

  44. pep.

    Can I also publish my XEP "XMPP over ChaosPost"

  45. jonas’

    or in morse code with trump tweet time spacings

  46. jonas’

    pep., would be something for April 1st

  47. pep.

    But it'd be valid even if you need to pay a ticket to get to congress?

  48. Zash

    Is the specification for ChaosPost available?

  49. pep.

    https://c3post.de/

  50. marc0s

    hi, by reading XEP-0114 (Components) I understand that, given a component connecting with the proper `secret` it can act as any valid user since it's allowed to write whatever `from` it pleases, right?

  51. Kev

    On the domain that the component is hosting - which is a different domain from that of the server.

  52. flow

    marc0s, I'd say now

  53. flow

    err, 'no'

  54. Kev

    So if I'm isode.com, and I have a component authenticating as component.isode.com, that component can act as anything@component.isode.com, but not anything@isode.com.

  55. marc0s

    I'm currently bridging another system events via a permanently connected user account with admin privileges to create/destroy/manage MUCs based on that other system's events and I was wondering if a component would be a better approach

  56. flow

    marc0s, you may want to look at xep356 (and xep355)

  57. marc0s

    I see Kev, thanks

  58. marc0s

    flow, will have a look, thanks

  59. Zash

    In Prosody you can have Components named user@host, so there's that.

  60. marc0s

    Zash, so the component will be receiving all stanzas addressed to the bare jid I'd expect, isn't it?

  61. MattJ

    Zash, no idea if that has ever been tested with external components

  62. marc0s

    😀

  63. MattJ

    Also ssshh, it's not a feature we advertise :)

  64. flow

    uh, hidden features you are not supposed to talk about, now I wanna use it!

  65. MattJ

    When people find out you end up with things like dino@dino.im

  66. pep.

    chat@dino.im :)

  67. MattJ

    That's the one

  68. jonas’

    MattJ, and also rodrigo.de.mucobedo@dreckshal.de.

  69. MattJ

    :)

  70. jonas’

    which is mod_client_proxy, another abomination

  71. Syed Ahmed Jamil

    Hi can anyone help me with pubsub. I have an entity that is both publisher and subscriber. I want the xmpp server (openfire) to not send my own published item back to me ? Is there any node configuration that makes this behavior happen ?

  72. Syed Ahmed Jamil

    Is anyone online ?

  73. jonas’

    yes

  74. jonas’

    I don’t think what you’re asking for works with standard XEP-0060

  75. Syed Ahmed Jamil

    ok is there any other solution ?

  76. jonas’

    don’t worry about those "reflections"

  77. jonas’

    you can detect them by ID

  78. Syed Ahmed Jamil

    Basically they are a problem for my app. I am creating a collaborative whiteboard. I publish drawing events and listen to incoming messages. so whenever I draw I receive my own drawing events and it redraws on screen.

  79. Syed Ahmed Jamil

    which ID do you mean

  80. Syed Ahmed Jamil

    ?

  81. Syed Ahmed Jamil

    ?

  82. jonas’

    Syed Ahmed Jamil, pubsub items have an ID

  83. jonas’

    if you set the ID when publishing (for example, to a randomly generated UUID), you can detect your own events and ignore them

  84. Syed Ahmed Jamil

    oh I see then I have to work on creating those unique id's

  85. moparisthebest

    id=ignoreme; if(id == ignorme) ignore()

  86. Syed Ahmed Jamil

    well if I set the id myself you mean when i will get that id in IQ stanza right ?

  87. Syed Ahmed Jamil

    basically now I have to set publisher id in every payload im sending from my app. now I have to update all those payloads to include publisher id as well

  88. Syed Ahmed Jamil

    Alas! I wish there was some configuration for that on the server side

  89. jonas’

    Syed Ahmed Jamil, no, I mean the ID of the pubsub item

  90. jonas’

    sorry, I misunderstood

  91. jonas’

    no, you’ll get the ID in the <message/> of the notification

  92. jonas’

    (notifications arrive via <message/>, not via <iq/>)

  93. Syed Ahmed Jamil

    yes I can see the random id in the message stanza I am receiving.

  94. Syed Ahmed Jamil

    now I just have to update all places in my code where I'm publishing an item to include my own unique id

  95. Syed Ahmed Jamil

    that is a real pain lol

  96. Syed Ahmed Jamil

    I really should have look at this earlier before creating all those pubsub events. I left this problem thinking I might be able to configure node some how.

  97. Syed Ahmed Jamil

    Anyway thanks Jonas and moparisthebest