ProxyMachine7 层 TCP 路由代理
Proxy Machine 是一个简单的 7 层 TCP 路由代理,基于 EventMachine 构建,可使用 Ruby 语言配置路由规则。如果你需要将不同的请求内容转发到后端不同的服务器上,那么 ProxyMachine 非常适合你。
ProxyMachine 主要为 Github 的集群架构而开发,每天可代理几百万请求,性能和内存占用表现良好。
安装:
$ gem install proxymachine -s http://gemcutter.org
使用方法:
Usage: proxymachine -c <config file> [-h <host>] [-p <port>] Options: -c, --config CONFIG Configuration file -h, --host HOST Hostname to bind. Default 0.0.0.0 -p, --port PORT Port to listen on. Default 5432
示例配置:
class GitRouter # Look at the routing table and return the correct address for +name+ # Returns "<host>:<port>" e.g. "ae8f31c.example.com:9418" def self.lookup(name) ... end end # Perform content-aware routing based on the stream data. Here, the # header information from the Git protocol is parsed to find the # username and a lookup routine is run on the name to find the correct # backend server. If no match can be made yet, do nothing with the # connection. proxy do |data| if data =~ %r{^....git-upload-pack /([\w\.\-]+)/[\w\.\-]+\000host=\w+\000} name = $1 { :remote => GitRouter.lookup(name) } else { :noop => true } end end
评论
httpgatehttp7层代理软件
httpgate为webserver及后端的业务逻辑提供良好的保护功能,最大限度屏蔽恶意访问。httpgate是一个http7层代理软件,专注于http代理及http防攻击,具备如下特点:采用事件驱动
httpgatehttp7层代理软件
0
FdslightIP 层代理软件
Fdslight是一款部署在网关节点的IP层代理软件(Linux当作网关机),支持智能代理,可以加速你的海外网络访问。功能说明:支持UDP穿透技术,即P2P技术。TCP使用黑名单:在名单内的使用代理,
FdslightIP 层代理软件
0
通过源码理解http层和tcp层的keep-alive
很久没更新文章了,今天突然想到这个问题,打算深入理解一下。我们知道建立tcp连接的代价是比较昂贵的,三次握手,慢开始,或者建立一个连接只为了传少量数据。这时候如果能保存连接,那会大大提高效率。下面我们通...
高级前端进阶
0