Giter Site home page Giter Site logo

geekwalk's Introduction

Geekwalk——目标是用Java实现精巧且带UI的反向代理服务器

标题有两重含义:

  1. 这是一个我用业余时间,慢慢打磨的项目,几乎所有的编程工作都会以B站 直播 / 录播 的形式共享出来,所以你会看到一个程序员亦步亦趋编写代码的全过程,故而命名为Geekwalk
  2. 反向代理服务器,在实际项目中主要扮演网关——Gateway的角色,因此本项目也以GW两个字母开头的单词作为呼应

已完成功能:

  • 实现反向代理关键代码
  • 反向代理支持配置文件
  • 增加单元测试
  • 支持静态站点部署
  • websocket反向代理
  • websocket反向代理追加单元测试
  • 压力测试一波,对比下Nginx
  • 反向代理支持负载均衡
  • 支持UI配置 开发完结

编译:

./gradlew shadowJar

常规部署:

java -jar build/libs/geekwalk-1.0-SNAPSHOT-fat.jar -conf src/test/resources/config.json

静默部署:

java -jar build/libs/geekwalk-1.0-SNAPSHOT-fat.jar start -conf src/test/resources/config.json

一个典型的config.json配置文件形如:

{
  "port": 9090,
  "frontend": [
    {
      "prefix": "/web1",
      "dir": "/Users/liurui/develop/workspace-github/geekwalk/src/test/resources/web1",
      "reroute404": "/web1",
      "cachingEnabled": true,
      "maxAgeSeconds": 30
    },
    {
      "prefix": "/web2",
      "dir": "/Users/liurui/develop/workspace-github/geekwalk/src/test/resources/web2",
      "cachingEnabled": false
    }
  ],
  "backend": [
    {
      "prefix": "/a",
      "upstream": [
        {
          "url": "http://127.0.0.1:8080/a",
          "weight": 1
        },
        {
          "url": "http://127.0.0.1:8080/a",
          "weight": 1
        }
      ]
    },
    {
      "prefix": "/b",
      "upstream": [
        {
          "url": "http://127.0.0.1:8081/b",
          "weight": 1
        },
        {
          "url": "http://127.0.0.1:8082/b",
          "weight": 1
        }
      ]
    },
    {
      "prefix": "/",
      "upstream": "http://127.0.0.1:8080/"
    }
  ]
}

geekwalk's People

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.