Git Product home page Git Product logo

nettygateway's Introduction

NettyGateway

  • English:NettyGateway is a HTTP proxy server with flexible routing rules.
  • Chinese:基于Netty编写的轻量级HTTP代理转发服务器,可以根据请求的内容关键字进行定制化的规则路由。相比于Nginx(OpenResty)通过lua脚本配置方式,进行的规则路由而言,配置更加简单。

如何用Netty实现一个轻量级的HTTP代理服务器

有兴趣的朋友可以点击查看:https://www.cnblogs.com/jietang/p/8926325.html


NettyGateway配置说明

  • NettyGateway默认启动端口8999,你可以通过netty-gateway.xml的gatewayPort属性进行配置。
  • 配置文件netty-gateway.properties,主要用来定义http post请求中url的路径(path)部分serverPath,以及当请求报文关键字没有匹配成功的时候,默认转发的URL地址defaultAddr。
  • 配置文件netty-route.properties,主要用来定义http post请求中url的路径(path)部分serverPath(路径部分定义必须在netty-gateway.properties中定义过),以及当请求报文关键字keyWord匹配成功的时候,路由转发的URL地址matchAddr。

NettyGateway代理转发场景描述


NettyGateway代理转发场景配置说明

#配置说明参考:
#netty-gateway.config2.serverPath ==> URL路径关键字。
#netty-gateway.config2.defaultAddr ==> 请求报文中的关键字没有匹配成功时,默认转发的URL地址。
netty-gateway.config2.serverPath=fcgi-bin/BSSP_SFC
netty-gateway.config2.defaultAddr=http://10.46.158.10:8089/fcgi-bin/BSSP_SFC
#注意config中的数字顺序递增即可。
#配置说明参考:
#netty-gateway.config3.serverPath ==> URL路径关键字。
#netty-gateway.config3.keyWord ==> 请求报文匹配关键字。支持1~N个关键字,多个关键字用逗号分割,关键字之间是逻辑与的关系。
#netty-gateway.config3.matchAddr ==> 请求报文关键字匹配成功时,转发的ULR地址。
netty-gateway.config3.serverPath=fcgi-bin/BSSP_SFC
netty-gateway.config3.keyWord=HelloWorldNettyGateway
netty-gateway.config3.matchAddr=http://10.46.158.20:8089/fcgi-bin/BSSP_SFC
#注意config中的数字顺序递增即可。

NettyGateway代理转发测试

nettygateway's People

Contributors

tang-jie 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.