Skip to content

Instantly share code, notes, and snippets.

View rokkish's full-sized avatar
🏠
Working from home

roki rokkish

🏠
Working from home
View GitHub Profile
@rokkish
rokkish / http_server_auth.py
Created April 18, 2024 06:42
basic auth for python
# Extended python -m http.serve with --username and --password parameters for
# basic auth, based on https://gist.github.com/fxsjy/5465353
from functools import partial
from http.server import SimpleHTTPRequestHandler, test
import base64
import os
class AuthHTTPRequestHandler(SimpleHTTPRequestHandler):