mirror of
				https://github.com/TeaOSLab/EdgeNode.git
				synced 2025-11-04 16:00:25 +08:00 
			
		
		
		
	源站支持HTTP/2
This commit is contained in:
		@@ -8,6 +8,7 @@ import (
 | 
			
		||||
	"github.com/TeaOSLab/EdgeNode/internal/goman"
 | 
			
		||||
	"github.com/TeaOSLab/EdgeNode/internal/remotelogs"
 | 
			
		||||
	"github.com/pires/go-proxyproto"
 | 
			
		||||
	"golang.org/x/net/http2"
 | 
			
		||||
	"net"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"runtime"
 | 
			
		||||
@@ -166,6 +167,11 @@ func (this *HTTPClientPool) Client(req *HTTPRequest,
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// support http/2
 | 
			
		||||
	if origin.HTTP2Enabled && origin.Addr != nil && origin.Addr.Protocol == serverconfigs.ProtocolHTTPS {
 | 
			
		||||
		_ = http2.ConfigureTransport(transport.Transport)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	rawClient = &http.Client{
 | 
			
		||||
		Timeout:   readTimeout,
 | 
			
		||||
		Transport: transport,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user