Added gopher http proxy support

This commit is contained in:
aewens 2018-10-02 17:30:44 -04:00
parent 67d781bd7c
commit be8adb6d7a
1 changed files with 6 additions and 0 deletions

View File

@ -235,6 +235,12 @@ def store_file(f, addr):
def store_url(url, addr):
if is_fhost_url(url):
return segfault(508)
# handler to convert gopher links to HTTP(S) proxy
gopher = "gopher://"
if url[:len(gopher)] = gopher:
address = url.split(gopher, 1)[1]
url = "https://gopher.tilde.team/{}".format(address)
h = { "Accept-Encoding" : "identity" }
r = requests.get(url, stream=True, verify=False, headers=h)