Pub/Sub from browser

789 views
Skip to first unread message

prafull jaltare

unread,
Dec 30, 2020, 9:40:52 PM12/30/20
to Google Cloud Pub/Sub Discussions
Hi
Can I publish or subscribe messages to/from browsers? The javascript library works from  NodeJS , but in browser I can't embed a nodeJS!  Can I implement an AJAX call back to receive pull messages from the Pub/Sub server?

Salvatore Sferrazza

unread,
Dec 31, 2020, 10:00:38 AM12/31/20
to prafull jaltare, Google Cloud Pub/Sub Discussions
Have you looked into using the googleapis/gapi javascript library with Pub/Sub's discovery document?  It would require auth from browser clients with sufficient permissions to publish/subscribe, however.

For distribution of Pub/Sub messages to anonymous web subscribers, there's a package on GitHub that allows for the configuration of a Kiubernetes cluster that will subscribe to a specified topic and distribute those messages over WebSockets.


Salvatore Sferrazza

sfer...@google.com

Financial Services Solutions Architect

+1 (212) 565-7668




On Wed, Dec 30, 2020 at 9:40 PM prafull jaltare <prama...@gmail.com> wrote:
Hi
Can I publish or subscribe messages to/from browsers? The javascript library works from  NodeJS , but in browser I can't embed a nodeJS!  Can I implement an AJAX call back to receive pull messages from the Pub/Sub server?

--
You received this message because you are subscribed to the Google Groups "Google Cloud Pub/Sub Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-pubsub-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-pubsub-discuss/8b7c5a4e-1bcf-408b-9202-6abaa3879204n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages