Go Http Proxy with Authentication, Schedule Control, and Portal Control

goproxy

Go Http Proxy with Authentication, Schedule Control, and Portal Control

Why this tool?

You may need to restrict my kids's youtube watch time in the after noon so they can focus on learning staff. This tool allow you to configure time based rule + host based rule for both whitelisting and blacklisting.

Building

$ go get
$ go build
$ ./goproxy -h
Usage of ./goproxy:
  -blacklist string
    	Blacklist schedule and host pattern file path (auto reload)
    	* 13-20 * * 1-5 (?i)youtube blacklists YouTube ignore case betwee 1:00pm and 8:59pm on Weekdays
    	 (default "blacklist")
  -default-allow
    	Default allow (or not) when when both whitelist & blacklist are present (default true)
  -h	Show this help
  -host string
    	Host or IP to bind
  -port int
    	Port number to bind (default 3408)
  -userlist string
    	Proxy user & password file in user:password (for each line) format (auto reload) (default "userlist")
  -whitelist string
    	Whitelist schedule and host pattern file path (auto reload)
    	* * * * 1-2,6,7 (?i)youtube whitelists YouTube on Monday, Tuesday, Saturday and Sunday
    	 (default "whitelist")

Running

$ goproxy -host 0.0.0.0 -port 3408 -blacklist blacklist_rules_file -whitelist whitelist_rules_file -userlist userlist_file

It is okay if you don't specify whitelist, blacklist and userlist, the default filename of "whitelist", "blacklist" and "userlist" will be tried. If they are not found, no blacklist/whitelist rules, no authentication http proxy will be ran. It is open to the world!

Running with systemd

[Unit]
Description=goproxy Service
After=syslog.target network.target

[Service]
User=appuser
Group=appgroup
Type=simple
WorkingDirectory=/path/to/rules_files_folder
ExecStart=/path/to/goproxy -host 0.0.0.0 -port 3408 -blacklist blacklist_rules_file -whitelist whitelist_rules_file -userlist userlist_file

[Install]
WantedBy=multi-user.target

Example rules

See examples folder

  1. When whitelist is specified but not blacklist is specified, the proxy only allow the whitelisted URLs by the time specified, and blocks all other access

  2. When blacklist is specified but not whitelist is specified, the proxy only block the blacklisted URLs by the time specified, and accepts all other access

  3. When both blacklist and whitelists is specified, blocking is checked first, if no decision, whitelist is checked, if still no deciison, the -default-allow flag is applied

  4. You can specify proxy user & password in the userlist file

  5. All Config files can be updated on the fly, and will be loaded within 5 seconds on next request. You don't need to restart the proxy.

  6. All non-HTTPs requests URLs are printed & logged, while HTTPs requests only log host & port

Similar Resources

Tcp-proxy - A dead simple reverse proxy server.

tcp-proxy A proxy that forwords from a host to another. Building go build -ldflags="-X 'main.Version=$(git describe --tags $(git rev-list --tags --max

Jan 2, 2022

Proxy - Minimalistic TCP relay proxy.

Proxy Minimalistic TCP relay proxy. Installation ensure you have go = 1.17 installed clone the repo cd proxy go install main.go Examples Listen on po

May 22, 2022

Smocker is a simple and efficient HTTP mock server and proxy.

Smocker is a simple and efficient HTTP mock server and proxy.

Smocker (server mock) is a simple and efficient HTTP mock server. The documentation is available on smocker.dev. Table of contents Installation With D

Jan 7, 2023

PlanB: a HTTP and websocket proxy backed by Redis and inspired by Hipache.

PlanB: a distributed HTTP and websocket proxy What Is It? PlanB is a HTTP and websocket proxy backed by Redis and inspired by Hipache. It aims to be f

Mar 20, 2022

Open Source HTTP Reverse Proxy Cache and Time Series Dashboard Accelerator

Open Source HTTP Reverse Proxy Cache and Time Series Dashboard Accelerator

Trickster is an HTTP reverse proxy/cache for http applications and a dashboard query accelerator for time series databases. Learn more below, and chec

Jan 2, 2023

HTTP proxy written in Go. COW can automatically identify blocked sites and use parent proxies to access.

COW (Climb Over the Wall) proxy COW 是一个简化穿墙的 HTTP 代理服务器。它能自动检测被墙网站,仅对这些网站使用二级代理。 English README. 当前版本:0.9.8 CHANGELOG 欢迎在 develop branch 进行开发并发送 pull

Jan 9, 2023

A CLI-based HTTP intercept and replay proxy

A CLI-based HTTP intercept and replay proxy

GLORP Glorp is an HTTP intercept proxy, allowing the inspection and replaying of HTTP requests. The layout and flow was designed to function similar t

Dec 14, 2022

Swiss Army knife Proxy tool for HTTP/HTTPS traffic capture, manipulation, and replay on the go.

Swiss Army knife Proxy tool for HTTP/HTTPS traffic capture, manipulation, and replay on the go.

Features • Installation • Usage • Running Proxify • Installing SSL Certificate • Applications of Proxify • Join Discord Swiss Army Knife Proxy for rap

Jan 8, 2023

Traefik proxy plugin to extract HTTP header value and create a new header with extracted value

Copy header value Traefik plugin Traefik plugin that copies HTTP header value with format key1=value1; key2=value2 into a new header. Motivation for t

May 26, 2022
Related tags
API used to help people schedule meetings, by getting their mutual timeslots.

1. Description API used to help people schedule meetings, by getting their mutual timeslots. 2. Documentation The API documentation can be found here.

Apr 17, 2022
A http proxy server chaining a upstream which needs authentication headers.

Normalize HTTP Proxy A http proxy server chaining a upstream which needs authentication headers. local -> [np] -> upstream -> destination Usage Norma

Dec 14, 2022
Transparent TLS and HTTP proxy serve and operate on all 65535 ports, with domain regex whitelist and rest api control

goshkan Transparent TLS and HTTP proxy serve & operating on all 65535 ports, with domain regex whitelist and rest api control tls and http on same por

Nov 5, 2022
A simple tool to convert socket5 proxy protocol to http proxy protocol

Socket5 to HTTP 这是一个超简单的 Socket5 代理转换成 HTTP 代理的小工具。 如何安装? Golang 用户 # Required Go 1.17+ go install github.com/mritd/s2h@master Docker 用户 docker pull m

Jan 2, 2023
Go-http-sleep: Delayed response http server, useful for testing various timeout issue for application running behind proxy

delayed response http server, useful for testing various timeout issue for application running behind proxy

Jan 22, 2022
An experimental Tor-Proxy serivce written in Go using Go-proxy and Go-libtor.

tor-proxy An experimental standalone tor-proxy service built with Go, using go-proxy, go-libtor and bine. This is a simple replacement to Tor's origin

Nov 9, 2022
IP2Proxy Go package allows users to query an IP address to determine if it was being used as open proxy, web proxy, VPN anonymizer and TOR exits.

IP2Proxy Go Package This package allows user to query an IP address if it was being used as VPN anonymizer, open proxies, web proxies, Tor exits, data

Sep 15, 2022
Battlesnake-logging-proxy - A little proxy between the internet and your battlesnake

battlesnake-logging-proxy a little proxy between the internet and your battlesna

Feb 11, 2022
mt-multiserver-proxy is a reverse proxy designed for linking multiple Minetest servers together

mt-multiserver-proxy mt-multiserver-proxy is a reverse proxy designed for linking multiple Minetest servers together. It is the successor to multiserv

Nov 17, 2022