Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
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 | |