Skip to content

Repository files navigation

vast.js

How to use

The following example initializes vast.js to a plain Node.JS HTTP server listening on port 3000.

varserver=require('http').Server();varvast=require('vast.js')(server);vast.on('connection',function(socket){// to perform a spatial publicationsocket.publish({name: John},{center: [35,45],radius: 100});// to subscribe a radiussocket.subscribe({center: [50,33],radius: 100},function(node){// move subscribed area to another center pointnode.move({center: [55,33]});});// receive subscribed messagessocket.on('message',function(data){});// receive enter / leave messagessocket.on('enter',function(node){});socket.on('leave',function(node){});// process disconnection from networksocket.on('disconnect',function(){});});server.listen(3000);

Standalone

varvast=require('vast.js')();vast.on('connection',function(socket){});vast.listen(3000);

In conjunction with ImonCloud

License

GPLv3

About

VAST.js is the javascript implementation of VAST: a scalable P2P network for spatial publish/subscribe (SPS)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages