This is a demo for A tutorial on using PeerJs in node-webkit app. It shows how to integrate PeerJs into your node-webkit/NW.js app, thus making your app able to do P2P communication.
It can be run on a single machine or two machines, your computer(s) needs to be connected to Internet.
-
Download node-webkit from here
-
Install node.js
-
Download this demo or
git clone https://github.com/laike9m/peerjs-with-nodewebkit-tutorial.git
-
Enter app directory, run
npm install
to install all dependencies -
Run the app. Node-webkit has great documentation on this.
-
Click
receive
button first, then clicksend
button.
If all goes well, you'll find a newly created file called received_gitignore
in app's directory. This file is exactly the same as .gitignore
, You just transferred it to yourself!
Step 1-6 is are the same, you should do them on both machines.
On one machine, click receive
button, on the other machine, click send
button. .gitignore
will be transferred and saved as received_gitignore
on receiving side.
See my tutorial: A tutorial on using PeerJs in node-webkit app