File: consumer

package info (click to toggle)
snapd 2.74.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 81,428 kB
  • sloc: sh: 16,966; ansic: 16,788; python: 11,332; makefile: 1,897; exp: 190; awk: 58; xml: 22
file content (22 lines) | stat: -rwxr-xr-x 541 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env python3

import sys
from http.server import BaseHTTPRequestHandler, HTTPServer

class testRequestHandler(BaseHTTPRequestHandler):
    def do_GET(self):
        self.send_response(200)

        self.send_header('Content-type', 'text/html')
        self.end_headers()

        message = b"<!doctype html>ok\n"
        self.wfile.write(message)

def run():
    server_address = ('localhost', 8081)
    httpd = HTTPServer(server_address, testRequestHandler)
    httpd.serve_forever()

if __name__ == '__main__':
  sys.exit(run())