Coder Social home page Coder Social logo

wpksainvgso's Introduction

yzhanProxy

Web reverse proxy with automatic SSL, LFU caching, command-line configuration
支持自动配置 SSL 证书、LFU 缓存、用命令行配置的 Web 反向代理服务器

Usage

Options:
-s, --src= Source URL List Required
-d, --dst= Destination URL List Required
-o, --opt= Option List: redirect=<30x>&cache_ext=<jpg|png|...>&cache_max_age=<1|2|...>
-g, --global= Global Config: cert_dir=<./cert>&cache_dir=<./cache>&cache_max_size=<100>
Help Options:
-h, --help Show this help message

Example

# sudo yzhanproxy-{platform}-amd64 \
sudo go run main.go \
-s http://localhost,https://localhost,https://x.com:81 \
-d https://localhost,https://www.google.com,https://m.baidu.com \
-o "redirect=302,cache_ext=ico|jpg|png|webp&cache_max_age=60|3600" \
-g "cert_dir=./cert&cache_dir=./cache&cache_max_size=100"

Meaning of Parameters

Redirect:
http://localhostRedirect: 302 —> https://localhost
Reverse Proxy:
https://localhostLocalhost: Self Signed Cert. Cache: ico - 60s, jpg|png|webp - 3600s —> https://www.google.com
https://x.com:81Domain: Auto Get/Renew Cert. No Cache —> https://m.baidu.com
Global Config with default value:
cert_dir: ./cert
cache_dir: ./cache
cache_max_size: 100 MB, LFU used to clean up least used files when exceeding max size

Screenshot

Reverse proxy Google using your own domain

reverseproxy.png

Console output

console.png

Development

Build

# Linux
./scripts/build.sh [name | default: yzhanproxy]
# Windows
./scripts/build.bat [name | default: yzhanproxy]

Unit Test

go test ./...

Thanks

  • ChatGPT: Assisting in coding and unit testing
  • go-flags

Migration Notice

This repo used to be mtfBetter (moved to mtfCOM), now it has be refactored using golang.

wpksainvgso's People

Contributors

eatme832 avatar

Watchers

 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.