Python Forum
Add password to HTTP.server
Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add password to HTTP.server
#1
I am playing about with the python 3 http server which works very well, but I need to add a simple user:password combination but have absolutely no idea how. Pointers most welcome. Thank you.


Quote:import http.server
import socketserver

PORT = 8080

Handler = http.server.SimpleHTTPRequestHandler

with socketserver.TCPServer(("", PORT), Handler) as httpd:
print("serving at port", PORT)
httpd.serve_forever()
Reply
#2
https://github.com/tianhuil/SimpleHTTPAu..._main__.py
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  http server whit proxy jrcruz 0 902 Feb-13-2019, 10:02 AM
Last Post: jrcruz
  python -m http.server giving invalid syntax echowit 5 3,155 May-17-2018, 02:13 PM
Last Post: echowit
  newbie here - need help with building very basic http server BenSalem 0 1,184 Aug-14-2017, 08:06 AM
Last Post: BenSalem

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020