global session cache

pull/2034/head
v2ray 2016-08-11 23:21:23 +02:00
parent 9e997a5be7
commit f03c86f468
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 5 additions and 0 deletions

View File

@ -27,6 +27,10 @@ const (
StreamSecurityTypeTLS StreamSecurityType = 1
)
var (
globalSessionCache = tls.NewLRUClientSessionCache(128)
)
type TLSSettings struct {
AllowInsecure bool
Certs []tls.Certificate
@ -35,6 +39,7 @@ type TLSSettings struct {
func (this *TLSSettings) GetTLSConfig() *tls.Config {
config := &tls.Config{
InsecureSkipVerify: this.AllowInsecure,
ClientSessionCache: globalSessionCache,
}
config.Certificates = this.Certs