1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-02-01 14:17:59 -05:00

global session cache

This commit is contained in:
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

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