all: add use_gzip configure and some improvements, see #28

This commit is contained in:
fatedier
2016-06-24 13:12:34 +08:00
parent 1987a399c1
commit c5e4b24f8f
15 changed files with 337 additions and 303 deletions

View File

@@ -122,15 +122,17 @@ func LoadConf(confFile string) (err error) {
}
// use_encryption
proxyClient.UseEncryption = 0
proxyClient.UseEncryption = false
useEncryptionStr, ok := section["use_encryption"]
if ok {
tmpRes, err := strconv.Atoi(useEncryptionStr)
if err != nil {
proxyClient.UseEncryption = 0
}
if ok && useEncryptionStr == "true" {
proxyClient.UseEncryption = true
}
proxyClient.UseEncryption = tmpRes
// use_gzip
proxyClient.UseGzip = false
useGzipStr, ok := section["use_gzip"]
if ok && useGzipStr == "true" {
proxyClient.UseGzip = true
}
ProxyClients[proxyClient.Name] = proxyClient