Skip to content

ufojs/wssjs

Repository files navigation

wssjs

A websocket server for your browser (uses ChromeApp API)

GithubTag Node Dependencies Build Status Stories in Ready License Gittip

Install the dependencies and compile the stack using npm install in the root folder of this project.

You'll find the bundle in ./lib/ folder; import it in your chrome app project using the <script> HTML tag and enjoy your in-browser websocket server. A sample application is located into ./integration-test folder.

Ultra-rapid tutorial

var someSockets = {};
var socketServer = new ufo.WSS();
socketServer.onopen = function(socket) {
  socket.onmessage = function(event) {
    console.log(event.data);
  };
  socket.onclose = function() {
    delete someSockets[socket.id];
  };
  someSockets[socket.id] = socket;
};
socketServer.listen();

About

A websocket server for your browser

Resources

License

Stars

Watchers

Forks

Packages

No packages published