Can I use socket.io in my Chrome Packaged App?

Viewed 2011

I need a socket.io connexion between a Chrome Packaged App and a NodeJS script. I'm familiar with both NodeJS and socket.io but not with Chrome Packaged App.

It seems to be difficult (I haven't find any doc explaining how to do that). I first try to simply load the socket.io.js script served from my NodeJS (http://localhost:8080/socket.io/socket.io.js). But it's forbidden by the CSP.

Then I found the socket.io-client . I'm not very familiar with english but I understand that it deals with loading the socket.io client script without the server, right ?

So I try to load the script "socket.io-client/socket.io-client.js" in my background.html page but chrome send me an error :

Uncaught Error: failed to require "socket.io" from "root"

I'm lost ... Before trying to go further, I simply ask myself if socket.io is a good idea to establish a dialog between my Packaged App and Nodejs.

And if it is, how can I load and run it an the client side ?

Edit : I wonder if I have to use classic Websocket instead of socket.io. I know it works with Packaged App as shown here but it'll take more time to develop the same functionalities socket.io give us (passing objet).

Thank you for your help :)

2 Answers
Related