分享
这是一个创建于 的主题,其中的信息可能已经有所发展或是发生改变。
## goTcpProxy
GitHub:https://github.com/zheng-ji/goTcpProxy
[](https://goreportcard.com/report/github.com/zheng-ji/goTcpProxy)
一个支持负载均衡,健康检查的 TcpProxy

### Description
#### English
* A tcp proxy service
* Supprot multi backend severs
* Consistent Hash Load Balance
* Auto detect down server, and remove it.
* Monitor backend health status
#### 中文
* TCP 代理服务
* 后端支持多个服务器
* 支持一致性哈希的负载均衡
* 自动检测失败的后端服务器,并移除
* 后端服务的健康检查接口
### How To Compile
```
cd $GOPATH;
git clone http://github.com/zheng-ji/goTcpProxy;
make
```
### How To Use
配置文件详解
```
bind: 0.0.0.0:9999 // 代理服务监听端口
wait_queue_len: 100 // 等待队列长度
max_conn: 10000 // 并发最大连接
timeout: 5 // 请求超时时间
failover: 3 // 后端服务允许失败次数
stats: 0.0.0.0:19999 // 健康检查接口
backend: // 后端服务列表
- 127.0.0.1:80
- 127.0.0.1:81
log:
level: "info"
path: "/Users/zj/proxy.log"
```
```
// 运行服务
./goTcpProxy -c=etc/conf.yaml
```

License
-------
Copyright (c) 2015 released under a MIT style license.
有疑问加站长微信联系(非本文作者)
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
关注微信8304 次点击
添加一条新回复
(您需要 后才能回复 没有账号 ?)
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码` - 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传