{"action":"opened","issue":{"url":"https://api.github.com/repos/strongloop/strong-pubsub-primus/issues/7","labels_url":"https://api.github.com/repos/strongloop/strong-pubsub-primus/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/strong-pubsub-primus/issues/7/comments","events_url":"https://api.github.com/repos/strongloop/strong-pubsub-primus/issues/7/events","html_url":"https://github.com/strongloop/strong-pubsub-primus/issues/7","id":104569414,"number":7,"title":"How to connect Primus from the browser","user":{"login":"Industrial","id":3317,"avatar_url":"https://avatars.githubusercontent.com/u/3317?v=3","gravatar_id":"","url":"https://api.github.com/users/Industrial","html_url":"https://github.com/Industrial","followers_url":"https://api.github.com/users/Industrial/followers","following_url":"https://api.github.com/users/Industrial/following{/other_user}","gists_url":"https://api.github.com/users/Industrial/gists{/gist_id}","starred_url":"https://api.github.com/users/Industrial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Industrial/subscriptions","organizations_url":"https://api.github.com/users/Industrial/orgs","repos_url":"https://api.github.com/users/Industrial/repos","events_url":"https://api.github.com/users/Industrial/events{/privacy}","received_events_url":"https://api.github.com/users/Industrial/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-02T20:55:26Z","updated_at":"2015-09-02T20:55:26Z","closed_at":null,"body":"Hi.\r\n\r\n- My main goal for now for using strong-pubsub is to have a websocket layer that is backed by a backend that has both users - extensible - and ACL/RBAC.  Loopback has this, which is very nice :D. I'm not sure this is the intended use case; As I read through the strong-pubsub documentation I don't see the browser being mentioned anywhere specifically, and I see server-to-server communication in examples. Is it possible to connect a browser to strong-pubsub?\r\n- I have no experience using MQTT as a messaging layer (I did use Dnode and ZeroMQ) so I've opted for using Redis PUB/SUB as a broker (right?) with `strong-pubsub-redis`. When I try to create a connection from the browser to the Primus installed HTTP server (https://gist.github.com/Industrial/2b4b223d7a256e6775a4) I get the error `Uncaught TypeError: net.createConnection is not a function` because it's doing something with the adapter in the browser. It doesn't work like this: `Browser <--Primus--> server(Primus <-> hooks <-> Bridge) <--Adapter--> Broker` ?\r\n\r\n- I've checked the `strong-pubsub`'s `Client` class but couldnt find a disconnect event happening. Some protocols/libraries that primus may be configured to use (like engine.io) support the `close` event.  I'm not actually sure yet what I'd want to do in the browser when a disconnect happens but the NetworkManager class I had supported it earlier so I'd like to support it again :-). Maybe figuring out how to make an off-line mode would be a good use case. And triggering a reconnect strategy when a disconnect happens.\r\n"}}