Git Product home page Git Product logo

vhost's Introduction

vhost

vhost(write by golang)

如何使用

安装golang编译器,make工具

直接执行make即可

运行环境

目前仅测试Centos 7 x64

配置文件

目前不支持指定配置文件路径,请可执行程序目录下创建config.json,以下为参考配置:

规则如下:

  • 当用户访问http://example.com跳转到https://example.com,模式为直接HTTP 302跳转
  • 当用户访问https://example.com将启动TCP透传模式,将数据发送到127.0.0.1:18880,需要自行提供证书
  • 当用户访问http://www.example.com跳转到https://example.com,模式为直接HTTP 302跳转
  • 当用户访问http://autocert.example.com跳转到https://autocert.example.com,模式为直接HTTP 302跳转
  • 当用户访问https://autocert.example.com将启动反向代理模式,自动申请证书,将HTTP页面升级到HTTPS
  • 未指定的域名将匹配*规则

参数配置文件: config.json

{
  "http": 80,
  "https": 443,
  "domain": "统计页面入口域名,此域名不会转发",
  "username": "统计页面授权用户名",
  "password": "统计页面授权用户密码",
  "list": {
    "example.com": {
      "http_to": "https://example.com",
      "https_to": "127.0.0.1:18880"
    },
    "www.example.com": {
      "http_to": "https://example.com"
    },
    "autocert.example.com": {
      "http_to": "autocert://127.0.0.1:30080"
    },
    "*": {
      "http_to": "127.0.0.1:30080",
      "https_to": "127.0.0.1:30443"
    }
  }
}

vhost's People

Contributors

elitah avatar

Stargazers

 avatar

Watchers

 avatar  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.