|  | @@ -2,18 +2,27 @@
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  package transport
 |  |  package transport
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -import "encoding/json"
 |  | 
 | 
											
												
													
														|  | 
 |  | +import (
 | 
											
												
													
														|  | 
 |  | +	"encoding/json"
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +	"github.com/v2ray/v2ray-core/transport/hub/kcpv"
 | 
											
												
													
														|  | 
 |  | +)
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  func (this *Config) UnmarshalJSON(data []byte) error {
 |  |  func (this *Config) UnmarshalJSON(data []byte) error {
 | 
											
												
													
														|  |  	type JsonConfig struct {
 |  |  	type JsonConfig struct {
 | 
											
												
													
														|  | -		ConnectionReuse bool `json:"connectionReuse"`
 |  | 
 | 
											
												
													
														|  | 
 |  | +		ConnectionReuse bool         `json:"connectionReuse"`
 | 
											
												
													
														|  | 
 |  | +		EnableKcp       bool         `json:"EnableKCP,omitempty"`
 | 
											
												
													
														|  | 
 |  | +		KcpConfig       *kcpv.Config `json:"KcpConfig,omitempty"`
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  	jsonConfig := &JsonConfig{
 |  |  	jsonConfig := &JsonConfig{
 | 
											
												
													
														|  |  		ConnectionReuse: true,
 |  |  		ConnectionReuse: true,
 | 
											
												
													
														|  | 
 |  | +		EnableKcp:       false,
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  	if err := json.Unmarshal(data, jsonConfig); err != nil {
 |  |  	if err := json.Unmarshal(data, jsonConfig); err != nil {
 | 
											
												
													
														|  |  		return err
 |  |  		return err
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  	this.ConnectionReuse = jsonConfig.ConnectionReuse
 |  |  	this.ConnectionReuse = jsonConfig.ConnectionReuse
 | 
											
												
													
														|  | 
 |  | +	this.enableKcp = jsonConfig.EnableKcp
 | 
											
												
													
														|  | 
 |  | +	this.kcpConfig = kcpConfig
 | 
											
												
													
														|  |  	return nil
 |  |  	return nil
 | 
											
												
													
														|  |  }
 |  |  }
 |