Permalink
Browse files

More README fiddling.

  • Loading branch information...
spoletto committed Apr 8, 2012
1 parent 6948b1a commit 95c7b6559815382dda1c4e16460322b8a64275a6
Showing with 17 additions and 1 deletion.
  1. +17 −1 README.md
View
@@ -19,7 +19,7 @@ In order for all network traffic to be funneled through the websocket connection
Now, on your smartphone device, join the ad-hoc network.
When the HTML5 web app is loaded on the device, it will attempt to connect to a known, fixed IP address: 169.254.134.89. Before we can run the websocket server which will bind to that address, we must assign that IP address to the Wifi device of the client machine. To do so, run the following command, substituting `en1` with your Wifi device name.
When the HTML5 web app is loaded on the device, it will attempt to connect to a known, fixed IP address: `169.254.134.89`. Before we can run the websocket server which will bind to that address, we must assign that IP address to the Wifi device of the client machine. To do so, run the following command, substituting `en1` with your Wifi device name.
``` bash
$ sudo /sbin/ifconfig en1 inet 169.254.134.89 netmask 255.255.0.0 alias
@@ -31,5 +31,21 @@ Now, we can launch the websocket server.
$ sudo node client/ws-server.js
```
The websocket server will bind to `169.254.134.89:6354` and listen for new websocket connections.
Then, the websocket server will bring up a tun interface named `tun0` and assign the IP address `10.0.0.1` to it.
``` bash
$ sudo ifconfig tun0 10.0.0.1 10.0.0.1 netmask 255.255.255.0 up
```
It will then modify the IP routing table on the host machine to funnel all network traffic through the `tun0` device.
``` bash
$ sudo route delete default
$ sudo route add default 10.0.0.1
```
Now as network requests are issued, data will be written into `/dev/tun0`. The Node.js program will read all such data and broadcast it to connected clients. Similarly, as websocket messages are received, the Node.js program will write data into `/dev/tun0`, effectively injecting websocket data into the OS as received IP traffic.

0 comments on commit 95c7b65

Please sign in to comment.