create net-like streams between browser tabs. tabs.createServer, & tabs.connect
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
.gitignore
LICENSE
README.md
index.js
package.json

README.md

tab-stream

Create net style servers, connections between browser-tabs.

Using an ... ugly hack, messsages are sent between browser tabs/windows from the same domain.

Just pretend it's a net server unix socket...

Note, this can currently only connect to servers located on other tabs. this is incorrect, compared to the net module, because it should be possible to connect to a server created within the same process, but this feature is not important currently.

Example

var tab = require('tab-stream')

tab.createServer(function (stream) {
  //SERVER
}).listen('socket')

//CLIENT
tab.connect('socket')

Instead of a numerical port, passing a string will work. The idea is to make this as close to net as possible.

See also, autonode

License

MIT