Code Monkey home page Code Monkey logo

hivpn's Introduction

HIVPN

For some reason We needed to write my own VPN. And my reason is because of my company. I want to have full internet access. HiVPN will help to bypass the firewall to go out to the internet.

How it works

| My computer |<---------->TUN interface<--------->| websocket |<----------->VPN server<----------->| internet |

Support operating system

  • linux (vpn client and server)
  • Windows (only vpn client)

Features:

  • HTTP Websocket
  • All data is encrypted
  • Easy to use CLI

Use

Server Mode(VPN Server)

Only support linux

Setting route

echo 1 > /proc/sys/net/ipv4/ip_forward
# Masquerade outgoing traffic
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# Allow return traffic
iptables -A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT

Edit config.toml

Server         = "103.123.98.95:443" # server address
Address        = "172.16.0.1/24"  # ip address of the server
MTU            = 1500
TTL            = 30
# List user
Users = [
	{Username = "user", Password = "password", Ipaddress = "172.16.0.13/24"},
]

Run server

hivpn -S --config config.toml

Client Mode(VPN Client)

Linux & Windows

Note

On Windows need download Wintun. Download and unzip the file. The executable program needs to work with wintun.dll Put in the same directory

Edit config.toml

Server         = "103.123.98.95:443" # server public ip address
Address        = "172.16.0.10/24" # the ip address is configured in the config file on the server
DefaultGateway = "172.16.0.1" # ip address of the server(ip vpn)
MTU            = 1500
TTL            = 30
User           = "user" # the username is configured in the config file on the server
Pass           = "password" # the password is configured in the config file on the server
Whitelist 	   = [] # list of addresses not allowed to go through vpn. Only support CIDR. Example: "10.0.0.1/24"
Blacklist 	   = [] # blocked address list. Only suppory ip address not support CIDP. Example: "10.0.0.12"
Incognito      = false # developing

Run client

hivpn --config config.toml

TODO

  • dhcp
  • support other protocols that are not blocked by firewall
  • Add user dynamic

hivpn's People

Contributors

namcuongq avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.