3

Is it possible to add a basic authentication with simplehttpserver ?

I would like to restrict the access to a website using SimpleHTTPServer

Matthieu
  • 199
  • 2
  • 3
  • 15
  • Does this cover it -> http://stackoverflow.com/questions/4287019/stuck-with-python-http-server-with-basic-authentication-using-basehttp#8153189 ? – pd40 Mar 11 '17 at 21:24

1 Answers1

20

I recently wrote sauth for this reason. It's just humanized and properly packaged version of https://github.com/tianhuil/SimpleHTTPAuthServer with python3 support.

Try it:

~$ pip install sauth
~$ cd some_dir
~/some_dir $ sauth admin 12345 
Serving "/home/user/some_dir" directory on http://0.0.0.0:8333
Granitosaurus
  • 20,530
  • 5
  • 57
  • 82