This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from http.server import SimpleHTTPRequestHandler, HTTPServer | |
class CustomHTTPRequestHandler(SimpleHTTPRequestHandler): | |
def do_GET(self): | |
''' | |
Print request and call SimpleHTTPRequestHandler.do_GET() | |
to serve static files | |
''' | |
print(">"+"-"*40+"<") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
'''Usage: | |
python3 http-stdout-echo.py -a <bind-address> -p <bind-port> | |
Examples: | |
python3 http-stdout-echo.py # (will listen at 127.0.0.1:8080 by default) | |
python3 http-stdout-echo.py -a 10.3.1.3 -p 5555''' | |
from http.server import HTTPServer, BaseHTTPRequestHandler |