socket.io-sync is a tool collection which help you push files to any places you may want them be by network and socket.io
First of all, you should put siosync-server to where all siosync-push and siosync-pull can access. At the server where siosync-server placed in, run:
npm install --g siosync-serverCreate a config file siosync.js
module.exports={host: '127.0.0.1',port: 12345// any port you can use}Run it and keep it always running:
siosync-serverCheck siosync-server --help for more detail
Secondly, put siosync-pull to where you want files to be received. To be precise, siosync-pull is the end that pull files from siosync-server which actually from siosync-push:
npm install -g siosync-pullAnd create a config file siosync.js:
module.exports={socketHost : '127.0.0.1',// server hostsocketPort : 12345,// server portsocketPath : '/socket.io',// optional, default is 「/socket.io」room : 'abc',// any string but must match siosync-pushworkplacePath: '/home/user/mywork/'// put files to wherechmod : 0o777,// optional, chmod of file/dir, default is 777}Run it:
siosync-pullCheck siosync-pull --help for more detail
Proxy is not supported
Thirdly, put siosync-push to where you want files to be sent to other places:
npm install -g siosync-pushCreate a config file siosync.js:
module.exports={socketHost: '127.0.0.1',// server hostsocketPort: 12345,// server portsocketPath: '/socket.io',// optional, default is 「/socket.io」room: 'abc',// any string but must match siosync-pullpaths: ['push/'],// files/dirs to push, chokidar glob patternsworkplacePath: '/home/project'// optional, workplace dir, default is cwdignored: []// optional}Run it:
siosync-push
siosync-push --watch
siosync-push --watch --ignoreInitialCheck siosync-push --help for more detail
Proxy is supported