|
|
@@ -0,0 +1,44 @@ |
|
|
|
import http.server |
|
|
|
|
|
|
|
class EigenerHandler(http.server.BaseHTTPRequestHandler): |
|
|
|
def do_GET(self): |
|
|
|
self.send_response(200) |
|
|
|
self.end_headers() |
|
|
|
if self.path == "/ying": |
|
|
|
msg = """ |
|
|
|
<html> |
|
|
|
<head> |
|
|
|
<title> Titel der Seite </title> |
|
|
|
</head> |
|
|
|
<body> |
|
|
|
<a href="/yang">yang</a> |
|
|
|
<h1> ying</h1> |
|
|
|
</body> |
|
|
|
|
|
|
|
</html> |
|
|
|
""" |
|
|
|
else: |
|
|
|
|
|
|
|
msg = """ |
|
|
|
<html> |
|
|
|
<head> |
|
|
|
<title> Titel der Seite </title> |
|
|
|
</head> |
|
|
|
<body> |
|
|
|
<a href="/ying">ying</a> |
|
|
|
<h1> yang</h1> |
|
|
|
</body> |
|
|
|
|
|
|
|
</html> |
|
|
|
|
|
|
|
""" |
|
|
|
self.wfile.write(msg.encode('utf-8')) |
|
|
|
|
|
|
|
|
|
|
|
port = 12345 |
|
|
|
handler = EigenerHandler |
|
|
|
adress = ('', port) |
|
|
|
server = http.server.HTTPServer(adress, handler) |
|
|
|
server.serve_forever() |
|
|
|
|
|
|
|
|