socket-session-client

Socket-session is a sessioning system designed to restore accidental disconnects.

Usage no npm install needed!

<script type="module">
  import socketSessionClient from 'https://cdn.skypack.dev/socket-session-client';
</script>

README

How to use Socket-Session-Client

setting up the client

Luckily for you, it's easy. Make sure you have a working version of Socket.io-client. Require the package (With browserify or just with the server)

session = require("socket-session-client");

When that's done, and after you've connected socket.io, you need to get the socket variable that socket has passed you back, and run the init function using it.

session.main(socket);

That should be it! You'll see a few messages appear in the consoles of both the client and the server if everything goes well.

Make sure you have and are connecting to a working version of the server.