zheng-ji / gotcpproxy Goto Github PK
View Code? Open in Web Editor NEW一个支持负载均衡,健康检查的 TcpProxy
License: MIT License
一个支持负载均衡,健康检查的 TcpProxy
License: MIT License
代码不够健壮,日志文件目录不存在时,程序启动就panic了
不应该在select的default中添加一行:
oneSide <- true
么?
在log.go文件中 存在 代码:
if _, err := os.Stat(dirPath); os.IsNotExist(err) { //检查目录是否存在
os.Mkdir(dirPath, 0775) //创建目录 建议修改为 os.MkdirAll(dirPath,0775)
}
default:
from.SetReadDeadline(time.Now().Add(time.Duration(pConfig.Timeout) * time.Second))
read, err = from.Read(bytes)
if err != nil {
complete <- true
one_side <- true
return
}
to.SetReadDeadline(time.Now().Add(time.Duration(pConfig.Timeout) * time.Second)) // 这个应该是to.SetWriteDeadline ???
_, err = to.Write(bytes[:read])
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.