2021-05-01 08:25:29 +08:00
2021-04-23 19:05:44 +08:00
2021-04-30 23:22:01 +08:00
2021-04-30 20:29:53 +08:00
2021-04-30 20:29:53 +08:00
2021-04-29 20:29:35 +08:00
2021-05-01 07:51:49 +08:00
2021-05-01 07:51:49 +08:00
2021-04-30 18:39:00 +08:00
2021-04-23 19:05:44 +08:00
2021-05-01 08:03:46 +08:00
2021-04-20 22:38:19 +08:00
2021-04-20 22:38:19 +08:00
2019-08-24 23:01:32 +08:00
2021-05-01 08:25:29 +08:00
2021-05-01 08:25:29 +08:00

opennotr

Build Status Go Report Card

opennotr is a nat tranversal application base on a VPN tunnel and openresty.

opennotr provides http, https, grpc, tcp and udp nat traversal. For http, https, grpc, opennotr supports multi client share the 80/443 ports, it maybe useful for wechat, facebook webhook debug.

Status: Alpha

The technical architecture of opennotr

doc/assets/opennotr.jpg

Table of Contents

Features

opennotr provides these features:

  • Supports multi protocol, http, https, grpc, tcp, udp.
  • Multi client shares the same http, https, grpc port, for example: client A use a.notr.tech domain, client B use b.notr.tech, they can both use 80 port for http. Opennotr use openresty for dynamic upstream.
  • Dynamic dns support, opennotr use coredns and etcd for dynamic dns.
  • Support stream proxy plugin

Back to TOC

Build

Build binary:

./build_exec.sh

The binary file will created in bin folder.

Build docker image:

./build_image.sh

This scripts will run build_exec.sh and build an image name opennotr

Back to TOC

Install

Install via docker-compose

  1. create configuration file

mkdir /opt/data/opennotrd

An example of configuration folder tree is:

root@iZwz97kfjnf78copv1ae65Z:/opt/data/opennotrd# tree
.
|-- cert ---------------------> cert folder
|   |-- upstream.crt
|   `-- upstream.key
`-- notrd.yaml ---------------> opennotr config file

2 directories, 5 files

the cert folder MUST be created and the crt and key file MUST created too.

root@iZwz97kfjnf78copv1ae65Z:/opt/data/opennotrd# cat notrd.yaml
server:
  listen: ":10100"
  authKey: "client server exchange key"
  domain: "open.notr.tech"

dhcp:
  cidr: "100.64.242.1/24"
  ip: "100.64.242.1"

upstream:
  remoteAddr: "http://127.0.0.1:81/upstreams"

the only one configuration item you should change is domain: "open.notr.tech", replace open.notr.tech with your own domain.

  1. Run with docker

docker run --privileged --net=host -v /opt/logs/opennotr:/opt/resty-upstream/logs -v /opt/data/opennotrd:/opt/conf -d opennotr

Or use docker-compose

wget https://github.com/ICKelin/opennotr/blob/develop/docker-build/docker-compose.yaml

docker-compose up -d opennotrd

Back to TOC

Plugin

opennotr provide plugin interface for developer, Yes, tcp and udp are buildin plugins.

For a new plugin, you should implement the Proxier interface which contains RunProxy method.

type Proxier interface {
	RunProxy(item *ProxyItem) error
}

And then import the plugin pakcage in main.go

import _ "path to you plugin package"

Technology details

Back to TOC

Author

A programer name ICKelin.

Description
Languages
Go 99.4%
Shell 0.5%