Juno360219's picture
new file
952d836
raw
history blame
512 Bytes
from http.server import BaseHTTPRequestHandler, HTTPServer
import socketserver
class ProxyHandler(BaseHTTPRequestHandler):
def do_GET(self):
if self.path == '/':
self.send_error(200)
self.end_headers()
return 'Hello World!'
elif self.path == '/block':
self.send_response(403)
self.end_headers()
return 'Access denied.'
else:
self.translate_uri_to_unix(self.path)
# Send request to target