This file contains hidden or 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
# Proxy echo TCP server program | |
import socket | |
HOST = "localhost" | |
PORT = 6667 | |
HOST_NEW = "localhost" | |
PORT_NEW = 6666 | |
CONNECTED = False |
This file contains hidden or 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
# ruff: noqa: N802, N815, E501 | |
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE | |
# Written by Nathan Hamiel (2010) | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
from optparse import OptionParser | |
class RequestHandler(BaseHTTPRequestHandler): |
This file contains hidden or 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
import logging | |
from logging.handlers import HTTPHandler as HTTPLoggingHandler | |
from typing import Any | |
class ExternalFilter(logging.Filter): | |
flag = "to_external_source" | |
def filter(self, record: logging.LogRecord) -> bool: | |
return getattr(record, self.flag, False) |
OlderNewer