2780b81406
Some checks failed
linux-mips-gcc / linux-gcc-mipsel (Debug) (push) Waiting to run
linux-mips-gcc / linux-gcc-mipsel (Release) (push) Waiting to run
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Waiting to run
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Waiting to run
linux-riscv64-gcc / linux-gcc-riscv64 (Debug) (push) Waiting to run
linux-riscv64-gcc / linux-gcc-riscv64 (Release) (push) Waiting to run
linux-x64-gcc / linux-gcc (Debug) (push) Waiting to run
linux-x64-gcc / linux-gcc (Release) (push) Waiting to run
linux-x86-gcc / linux-gcc (Debug) (push) Waiting to run
linux-x86-gcc / linux-gcc (Release) (push) Waiting to run
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Debug) (push) Failing after 1m24s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Release) (push) Failing after 1m45s
linux-arm-gcc / linux-gcc-arm (Debug) (push) Failing after 1m39s
linux-arm-gcc / linux-gcc-arm (Release) (push) Failing after 1m38s
linux-arm-gcc / linux-gcc-armhf (Debug) (push) Failing after 2m19s
linux-arm-gcc / linux-gcc-armhf (Release) (push) Has been cancelled
25 lines
685 B
Python
25 lines
685 B
Python
#!/usr/bin/python3
|
|
import http.server
|
|
import socket
|
|
import socketserver
|
|
from http.server import HTTPServer, BaseHTTPRequestHandler
|
|
|
|
PORT = 8000
|
|
|
|
class Request(BaseHTTPRequestHandler):
|
|
def do_GET(self):
|
|
code = int(self.path.split("/")[1])
|
|
|
|
self.send_response(code)
|
|
self.send_header('Content-type', 'text/plain')
|
|
self.end_headers()
|
|
|
|
class HTTPServer(socketserver.TCPServer):
|
|
def server_bind(self):
|
|
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
|
self.socket.bind(self.server_address)
|
|
|
|
Handler = http.server.SimpleHTTPRequestHandler
|
|
with HTTPServer(("", PORT), Request) as httpd:
|
|
httpd.serve_forever()
|