forked from tildeverse/ttm.sh
Added gopher http proxy support
This commit is contained in:
parent
67d781bd7c
commit
be8adb6d7a
6
fhost.py
6
fhost.py
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue