mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-09-03 02:04:34 -04:00
18 lines
361 B
Go
18 lines
361 B
Go
// +build json
|
|
|
|
package transport
|
|
|
|
import "encoding/json"
|
|
|
|
func (this *Config) UnmarshalJSON(data []byte) error {
|
|
type JsonConfig struct {
|
|
ConnectionReuse bool `json:"connectionReuse"`
|
|
}
|
|
jsonConfig := new(JsonConfig)
|
|
if err := json.Unmarshal(data, jsonConfig); err != nil {
|
|
return err
|
|
}
|
|
this.ConnectionReuse = jsonConfig.ConnectionReuse
|
|
return nil
|
|
}
|