Skip to content
This repository was archived by the owner on Jan 17, 2021. It is now read-only.

Commit b1f09c7

Browse files
committed
fix mobile get pac file error
1. Change listen ip to 0.0.0.0 2. Mobile can't fetch pac file and CA file without forward_local
1 parent 1bba14f commit b1f09c7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pythonlib/local/proxy_handler.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def forward_local(self):
107107
out_list.append(("%s: %s\r\n" % (key, value)).encode('iso-8859-1'))
108108
out_list.append(b"\r\n")
109109
out_list.append(content)
110-
self.wfile.write(b"".join(out_list))
110+
if content: self.wfile.write(b"".join(out_list))
111111

112112
def do_METHOD(self):
113113
touch_active()
@@ -130,6 +130,10 @@ def do_METHOD(self):
130130
if host.startswith("127.0.0.1") or host.startswith("localhost"):
131131
return self.forward_local()
132132

133+
if host_ip == config.get_listen_ip():
134+
xlog.info("Browse localhost by proxy")
135+
return self.forward_local()
136+
133137
self.parsed_url = urllib.parse.urlparse(self.path)
134138

135139
if host in config.HOSTS_GAE:

0 commit comments

Comments
 (0)