Skip to content

Commit 83e33a2

Browse files
committed
Use the Qubes update proxy for all HTTP requests when running in a TemplateVM
1 parent 7aebc1b commit 83e33a2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

usr/lib/python3/dist-packages/browser_choice/browser_choice_present.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
## NOTE: This file must not be named 'browser_choice.py', it confuses mypy.
1313
## See https://github.com/python/mypy/issues/19410
1414

15+
import os
1516
import sys
1617
import traceback
1718
import subprocess
@@ -277,6 +278,15 @@ def __init__(self, parent: QWidget | None = None):
277278

278279
if GlobalData.qube_type == "templatevm":
279280
self.is_network_connected: bool = True
281+
os.environ["https_proxy"]="http://127.0.0.1:8082/"
282+
os.environ["http_proxy"]="http://127.0.0.1:8082/"
283+
os.environ["HTTPS_PROXY"]="http://127.0.0.1:8082/"
284+
## Not setting HTTP_PROXY, as applications generally ignore it for
285+
## security reasons. See:
286+
##
287+
## https://superuser.com/questions/876100/https-proxy-vs-https-proxy
288+
## https://github.com/golang/go/issues/16405
289+
## https://httpoxy.org/
280290
else:
281291
self.is_network_connected = (
282292
subprocess.run(

0 commit comments

Comments
 (0)