/cutevpn

A VPN with built-in failover and load balancing

Primary LanguageGoMIT LicenseMIT

CuteVPN

Features

  • Has a built-in routing protocol, so it can switch between different links when failure.
  • Support load balancing. It can send network packets through different links concurrently when available.
  • Support many kinds of links(TCP, UDP, IP).
  • Can work on different layers, on TCP(like Shadowsocks) or IP(like OpenVPN).

Usage

Config

The format of config is TOML

Virtual Network Establishment

  • cidr, String. The IP address and the subnet mask of the node. 192.168.1.234/24
    This is similar to the command ip address add 192.168.1.234/24

  • gateway, String. The route for destinations outside of the subnet

  • cipher, String. The encryption algorithm. aesgcm

  • secret, String. The encryption key.
    This is a hex-encoded string and it will be used as the encryption key directly.
    A random 256-bits key can be generated by xxd -p -l 32 -c 32 /dev/random

  • links, Array of Tables. A link is a point-to-point tunnel.
    Each link has 3 config items.

    • link, String. udp4 or tcp4.
    • dial, String. The peer's listen address and port of the link. 4.3.2.1:54321
    • listen, String. The listen address and port of this link. 1.2.3.4:12345

Debug HTTP Server

  • httpserver, String. The listen address and port of the HTTP server. Some debug information can be fetched from this HTTP server.

Extra configs

These config items are not related to the VPN. They are some extra functions for convenience

  • started, String. Bash script which will be executed after the vpn started.
  • stopped, String. Bash script which will be executed after the vpn stopped.
  • socks5server, String. The listen address and port of a SOCKS5 server.

Build

Install Go. https://golang.org/doc/install

Install dep. https://github.com/golang/dep#installation

git clone https://github.com/clmul/cutevpn $GOPATH/src/github.com/clmul/cutevpn
cd $GOPATH/src/github.com/clmul/cutevpn/cutevpn
dep ensure
go build