implement ToyVpn in native golang shared libraries.
- call native golang shared library
- go through TCP, not UDP
for apk:
$ cd jni/ $ sh build.sh $ cd .. $ ./gradlew build --info
apk file will at: build/outputs/apk/
for server:
$ cd server/golang/ $ git clone https://github.com/songgao/water.git $ go build server.go
# Enable IP forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
# Pick a range of private addresses and perform NAT over eth0.
iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -o eth0 -j MASQUERADE
# Create a TUN interface.
tunctl -n -t tun2
# Set the addresses and bring up the interface.
ifconfig tun2 10.0.0.0/8 up
# Create a server on port 23456 with shared secret "test123456".
cd server/golang/
./server -bind ":23456" -tun tun2 -m 1400 -s test123456
- fix buggy Android log
- show current status and notification