Because friends don't let friends localhost.
Go to file
AJ ONeal e740d2ca0f heavier refactoring 2020-04-30 04:43:36 -06:00
client minor fs denesting 2020-04-29 23:52:44 -06:00
cmd heavier refactoring 2020-04-30 04:43:36 -06:00
dump make Prettier 2020-04-28 00:58:26 -06:00
envelope minor fs denesting 2020-04-29 23:52:44 -06:00
html/admin make Prettier 2020-04-28 00:58:26 -06:00
packer minor fs denesting 2020-04-29 23:52:44 -06:00
relay heavier refactoring 2020-04-30 04:43:36 -06:00
rvpn-docker heavier refactoring 2020-04-30 04:43:36 -06:00
server heavier refactoring 2020-04-30 04:43:36 -06:00
sni minor fs denesting 2020-04-29 23:52:44 -06:00
tools make admin domain more configurable 2020-04-28 01:16:16 -06:00
vendor vendor deps 2020-04-28 00:26:14 -06:00
.gitignore heavier refactoring 2020-04-30 04:43:36 -06:00
.ignore cleanup 2020-04-28 00:47:31 -06:00
.jshintrc make Prettier 2020-04-28 00:58:26 -06:00
.prettierrc make Prettier 2020-04-28 00:58:26 -06:00
README.md heavier refactoring 2020-04-30 04:43:36 -06:00
debug.sh minor fs denesting 2020-04-29 23:52:44 -06:00
go.mod heavier refactoring 2020-04-30 04:43:36 -06:00
go.sum heavier refactoring 2020-04-30 04:43:36 -06:00
telebit-relay.yaml heavier refactoring 2020-04-30 04:43:36 -06:00
telebit.go heavier refactoring 2020-04-30 04:43:36 -06:00

README.md

RVPN Server

branch: load-balancing

  • code now passes traffic using just Root tools
  • this will require serve-https and node-tunnel-client to work
  • the system supports round-robin load balancing

Build RVPN

go build -mod vendor ./cmd/telebit/
go build -mod vendor ./cmd/telebitd/

Setup Some Entries

/etc/hosts:

127.0.0.1 tunnel.example.com rvpn.rootprojects.invalid hfc2.rootprojects.org hfc.rootprojects.org

Start Up Webserver

tmp $ cd /tmp
tmp $ vim index.html --- Place some index content
tmp $ serve-https -p 8080 -d /tmp --servername hfc.rootprojects.org --agree-tos --email henry.f.camacho@gmail.com

Start Tunnel Client

# For .env
TELEBIT_SECRET=abcdef1234567890
node-tunnel-client $ bin/stunnel.js --locals http://hfc.rootprojects.org:8080,http://test1.hfc.rootprojects.org:8080 --stunneld wss://localhost.rootprojects.org:8443 --secret abcdef1234567890

Execute RVPN

./telebitd
INFO: packer: 2017/03/02 19:16:52.652109 run.go:47: startup
-=-=-=-=-=-=-=-=-=-=
INFO: genericlistener: 2017/03/02 19:16:52.652777 manager.go:77: ConnectionTable starting
INFO: genericlistener: 2017/03/02 19:16:52.652806 connection_table.go:67: ConnectionTable starting
INFO: genericlistener: 2017/03/02 19:16:52.652826 manager.go:84: &{map[] 0xc420072420 0xc420072480}
INFO: genericlistener: 2017/03/02 19:16:52.652832 connection_table.go:50: Reaper waiting for  300  seconds
INFO: genericlistener: 2017/03/02 19:16:52.652856 manager.go:100: register fired 8443
INFO: genericlistener: 2017/03/02 19:16:52.652862 manager.go:110: listener starting up  8443
INFO: genericlistener: 2017/03/02 19:16:52.652868 manager.go:111: &{map[] 0xc420072420 0xc420072480}
INFO: genericlistener: 2017/03/02 19:16:52.652869 conn_tracking.go:25: Tracking Running

Browse via tunnel

https://hfc.rootprojects.org:8443

Test Load Balancing

In a new terminal

node-tunnel-client $ bin/stunnel.js --locals http://hfc.rootprojects.org:8080,http://test1.hfc.rootprojects.org:8080 --stunneld wss://localhost.rootprojects.org:8443 --secret abc123

Check Results

{
	"type": "servers/GET",
	"schema": "",
	"txts": 1490473843,
	"txid": 8,
	"error": "ok",
	"error_description": "",
	"error_uri": "",
	"result": {
		"servers": [{
			"server_name": "0xc42014a0c0",
			"server_id": 1,
			"domains": [{
				"domain_name": "hfc.rootprojects.org",
				"server_id": 1,
				"bytes_in": 4055,
				"bytes_out": 8119,
				"requests": 12,
				"responses": 12,
				"source_addr": "127.0.0.1:55875"
			}, {
				"domain_name": "test1.hfc.rootprojects.org",
				"server_id": 1,
				"bytes_in": 0,
				"bytes_out": 0,
				"requests": 0,
				"responses": 0,
				"source_addr": "127.0.0.1:55875"
			}],
			"duration": 182.561747754,
			"idle": 21.445976033,
			"bytes_in": 8119,
			"bytes_out": 4055,
			"requests": 12,
			"responses": 12,
			"source_address": "127.0.0.1:55875"
		}, {
			"server_name": "0xc4200ea3c0",
			"server_id": 2,
			"domains": [{
				"domain_name": "hfc.rootprojects.org",
				"server_id": 2,
				"bytes_in": 1098,
				"bytes_out": 62,
				"requests": 2,
				"responses": 2,
				"source_addr": "127.0.0.1:56318"
			}, {
				"domain_name": "test1.hfc.rootprojects.org",
				"server_id": 2,
				"bytes_in": 0,
				"bytes_out": 0,
				"requests": 0,
				"responses": 0,
				"source_addr": "127.0.0.1:56318"
			}],
			"duration": 65.481814913,
			"idle": 23.589609269,
			"bytes_in": 62,
			"bytes_out": 1098,
			"requests": 2,
			"responses": 2,
			"source_address": "127.0.0.1:56318"
		}]
	}
}