From f03c86f4689c095dc49bf116bfe8388538109275 Mon Sep 17 00:00:00 2001 From: v2ray Date: Thu, 11 Aug 2016 23:21:23 +0200 Subject: [PATCH] global session cache --- transport/internet/connection.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/transport/internet/connection.go b/transport/internet/connection.go index 61435cbdf..4a88bcabe 100644 --- a/transport/internet/connection.go +++ b/transport/internet/connection.go @@ -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