socket.io.requestify

Reroute web socket events as web requests

Usage no npm install needed!

<script type="module">
  import socketIoRequestify from 'https://cdn.skypack.dev/socket.io.requestify';
</script>

README

socket.io.requestify

synopsis

Re-route Socket.io events as regular web requests. This module makes more sense in the context of backbone.socket.io.

usage

install

npm install socket.io.requestify

server code

var io = require('socket.io');
var Requestify = require('socket.io.requestify');

new Requestify(8080, io);

new Requestify('http://localhost:80', io);

new Requestify({
    url: 'http://foo:3000',
    socket: io
});

new Requestify({
    port: 3000,
    socket: io
});

new Requestify({
    fetchEvent: 'pull',
    socket: io
});

todo

  • Ensure 'AJAX' urls are all relative to the server.
  • More unit tests