Hi all,
So I am trying to write an add-on to take advantage of a websocket api offered by a site that I love. They use socketcluster.io on server side, so I have no choice but to use that on client side.
I wrote a quick version, that works, by putting the socketcluster-client code into the content script of a panel, but I would like to move the socket connection into addon code so that I can have multiple content pages updated from a central source. To go into a little more detail, I would like to have a button with a panel attached to it, as well as a toolbar, that both get updated with the same information coming from the socket connection.
I created a new project and used NPM to install socketcluster-client and wrote out some test code, but when I try to ‘jpm run’ I get an error:
Module 'url' is not found at resource://gre/modules/commonjs/url.js
After doing a little research it seems like the issue is that jpm is NOT node, and so it doesn’t use the same core modules.
Is there ANY way to get around this issue? It seems like the modules that are missing are: url, util, http, https, crypto, and stream.
If this isn’t possible, could someone please explain why? I am new to jpm and would like to at least know more about it and its limitations.
Thanks!