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
  Paramiko Server -- Exception (server): Error reading SSH protocol banner ujlain 3 4,283 Jul-24-2023, 06:52 AM
Last Post: Gribouillis
  Server Http and Https JohnnyCoffee 2 1,929 Feb-10-2023, 12:56 AM
Last Post: Skaperen
  HTTP Server JohnnyCoffee 1 2,762 Mar-22-2021, 01:50 AM
Last Post: Larz60+
  http server whit proxy jrcruz 0 2,515 Feb-13-2019, 10:02 AM
Last Post: jrcruz
  python -m http.server giving invalid syntax echowit 5 7,094 May-17-2018, 02:13 PM
Last Post: echowit
  newbie here - need help with building very basic http server BenSalem 0 2,356 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