Просмотр исходного кода

Don't run an in-proxy proxy when using an upstream proxy

Rod Hynes 1 год назад
Родитель
Сommit
8336debfb1
1 измененных файлов с 10 добавлено и 2 удалено
  1. 10 2
      psiphon/controller.go

+ 10 - 2
psiphon/controller.go

@@ -2548,12 +2548,20 @@ func (controller *Controller) runInproxyProxy() {
 
 
 	compatibleNetwork := IsInproxyCompatibleNetworkType(controller.config.GetNetworkID())
 	compatibleNetwork := IsInproxyCompatibleNetworkType(controller.config.GetNetworkID())
 
 
-	if !allowProxy || !compatibleNetwork {
+	// Running an unstream proxy is also an incompatible case.
+
+	useUpstreamProxy := controller.config.UseUpstreamProxy()
+
+	if !allowProxy || !compatibleNetwork || useUpstreamProxy {
 		if !allowProxy {
 		if !allowProxy {
 			NoticeError("inproxy proxy: not allowed")
 			NoticeError("inproxy proxy: not allowed")
-		} else {
+		}
+		if !compatibleNetwork {
 			NoticeError("inproxy proxy: not run due to incompatible network")
 			NoticeError("inproxy proxy: not run due to incompatible network")
 		}
 		}
+		if useUpstreamProxy {
+			NoticeError("inproxy proxy: not run due to upstream proxy configuration")
+		}
 		if controller.config.DisableTunnels {
 		if controller.config.DisableTunnels {
 			// Signal failure -- and shutdown -- only if running in proxy-only mode. If also
 			// Signal failure -- and shutdown -- only if running in proxy-only mode. If also
 			// running a tunnel, keep running without proxies.
 			// running a tunnel, keep running without proxies.