Explorar o código

global session cache

v2ray %!s(int64=9) %!d(string=hai) anos
pai
achega
f03c86f468
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      transport/internet/connection.go

+ 5 - 0
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