Browse Source

Fix: explicit UseQUIC flag ensures QUIC is used regardless of QUICVersion setting

Rod Hynes 7 years ago
parent
commit
5f31e26b1d
2 changed files with 7 additions and 4 deletions
  1. 1 0
      psiphon/dialParameters.go
  2. 6 4
      psiphon/meekConn.go

+ 1 - 0
psiphon/dialParameters.go

@@ -547,6 +547,7 @@ func MakeDialParameters(
 		dialParams.meekConfig = &MeekConfig{
 		dialParams.meekConfig = &MeekConfig{
 			ClientParameters:              config.clientParameters,
 			ClientParameters:              config.clientParameters,
 			DialAddress:                   dialParams.MeekDialAddress,
 			DialAddress:                   dialParams.MeekDialAddress,
+			UseQUIC:                       protocol.TunnelProtocolUsesFrontedQUIC(dialParams.TunnelProtocol),
 			QUICVersion:                   dialParams.QUICVersion,
 			QUICVersion:                   dialParams.QUICVersion,
 			UseHTTPS:                      protocol.TunnelProtocolUsesMeekHTTPS(dialParams.TunnelProtocol),
 			UseHTTPS:                      protocol.TunnelProtocolUsesMeekHTTPS(dialParams.TunnelProtocol),
 			TLSProfile:                    dialParams.TLSProfile,
 			TLSProfile:                    dialParams.TLSProfile,

+ 6 - 4
psiphon/meekConn.go

@@ -75,12 +75,14 @@ type MeekConfig struct {
 	// where host may be a domain name or IP address.
 	// where host may be a domain name or IP address.
 	DialAddress string
 	DialAddress string
 
 
-	// QUICVersion indicates whether to use QUIC and which QUIC version
-	// to use. QUIC is not used when "".
+	// UseQUIC indicates whether to use HTTP/2 over QUIC.
+	UseQUIC bool
+
+	// QUICVersion indicates which QUIC version to use.
 	QUICVersion string
 	QUICVersion string
 
 
 	// UseHTTPS indicates whether to use HTTPS (true) or HTTP (false).
 	// UseHTTPS indicates whether to use HTTPS (true) or HTTP (false).
-	// Ignored when QUICVersion is configured.
+	// Ignored when UseQUIC is true.
 	UseHTTPS bool
 	UseHTTPS bool
 
 
 	// TLSProfile specifies the value for CustomTLSConfig.TLSProfile for all
 	// TLSProfile specifies the value for CustomTLSConfig.TLSProfile for all
@@ -216,7 +218,7 @@ func DialMeek(
 	var additionalHeaders http.Header
 	var additionalHeaders http.Header
 	var proxyUrl func(*http.Request) (*url.URL, error)
 	var proxyUrl func(*http.Request) (*url.URL, error)
 
 
-	if meekConfig.QUICVersion != "" {
+	if meekConfig.UseQUIC {
 
 
 		scheme = "https"
 		scheme = "https"