timeout settings in http proxy

This commit is contained in:
v2ray committed 2016-07-10 15:34:14 +02:00
1 parent 5e7d413404
commit 30041041d3
3 files changed
+5 -1

No files matched your search

+2
View File
@@ -12,11 +12,13 @@ import (
// UnmarshalJSON implements json.Unmarshaler
func (this *Config) UnmarshalJSON(data []byte) error {
type JsonConfig struct {
Timeout int `json:"timeout"`
}
jsonConfig := new(JsonConfig)
if err := json.Unmarshal(data, jsonConfig); err != nil {
return errors.New("HTTP: Failed to parse config: " + err.Error())
}
this.Timeout = jsonConfig.Timeout
return nil
}