ProxyMachine 7 层 TCP 路由代理开源项目

我要开发同款
匿名用户2015年02月17日
84阅读

技术信息

开源地址
https://github.com/NickPresta/chameleon
授权协议
MIT

作品详情

ProxyMachie是一个简单的7层TCP路由代理,基于EvetMachie构建,可使用Ruby语言配置路由规则。如果你需要将不同的请求内容转发到后端不同的服务器上,那么ProxyMachie非常适合你。

ProxyMachie主要为Github的集群架构而开发,每天可代理几百万请求,性能和内存占用表现良好。

安装:

$ gem istall proxymachie -s https://gemcutter.org

使用方法:

Usage:  proxymachie -c <cofig file> [-h <host>] [-p <port>]Optios:  -c, --cofig CONFIG              Cofiguratio file  -h, --host HOST                  Hostame to bid. Default 0.0.0.0  -p, --port PORT                  Port to liste o. Default 5432

示例配置:

class GitRouter  # Look at the routig table ad retur the correct address for +ame+  # Returs "<host>:<port>" e.g. "ae8f31c.example.com:9418"  def self.lookup(ame)    ...  eded# Perform cotet-aware routig based o the stream data. Here, the# header iformatio from the Git protocol is parsed to fid the # userame ad a lookup routie is ru o the ame to fid the correct# backed server. If o match ca be made yet, do othig with the# coectio.proxy do |data|  if data =~ %r{^....git-upload-pack /([\w\.\-]+)/[\w\.\-]+\000host=\w+\000}    ame = $1    { :remote => GitRouter.lookup(ame) }  else    { :oop => true }  eded

功能介绍

Proxy Machine 是一个简单的 7 层 TCP 路由代理,基于 EventMachine 构建,可使用 Ruby 语言配置路由规则。如果你需要将不同的请求内容转发到后端不同的服务器上,...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论