parent
450b96ea14
commit
af87cc6cad
@ -1,11 +1,38 @@
|
||||
#
|
||||
# _ __ ,---. .-._ _,.---._ ,---.
|
||||
# .-`.' ,`..--.' \ /==/ \ .-._ _,..---._ ,-.' , - `. .-.,.---. .--.' \
|
||||
# /==/, - \==\-/\ \ |==|, \/ /, /==/, - \ /==/_, , - \ /==/ ` \ \==\-/\ \
|
||||
# |==| _ .=. /==/-|_\ | |==|- \| ||==| _ _\==| .=. |==|-, .=., |/==/-|_\ |
|
||||
# |==| , '=',\==\, - \ |==| , | -||==| .=. |==|_ : ;=: - |==| '=' /\==\, - \
|
||||
# |==|- '..'/==/ - ,| |==| - _ ||==|,| | -|==| , '=' |==|- , .' /==/ - ,|
|
||||
# |==|, | /==/- /\ - \|==| /\ , ||==| '=' /\==\ - ,_ /|==|_ . ,'./==/- /\ - \
|
||||
# /==/ - | \==\ _.\=\.-'/==/, | |- ||==|-, _`/ '.='. - .' /==/ /\ , )==\ _.\=\.-'
|
||||
# `--`---' `--` `--`./ `--``-.`.____.' `--`--'' `--`-`--`--' `--`
|
||||
#
|
||||
# VERSION 0.5
|
||||
#
|
||||
# DO NOT USE IT ON PRODUCTION
|
||||
#
|
||||
|
||||
import http.server
|
||||
import socketserver
|
||||
import socket
|
||||
import ssl # For future implementation with Openssl
|
||||
|
||||
PORT = 8080 # Define the standard port
|
||||
IP = 'localhost'
|
||||
HOST = 'localhost' # Define the standard host
|
||||
Request = http.server.SimpleHTTPRequestHandler # Simple http request handler, it commits all files and directories within the SelfHost.py folder
|
||||
|
||||
with socketserver.TCPServer((IP, PORT), Request) as httpd: # ("ip address", desired port), call the resquests from files
|
||||
print("Running @ ",IP,':',PORT) # Simply outputs on terminal the port that the server is operating
|
||||
with socketserver.TCPServer((HOST, PORT), Request) as httpd: # ("host/ip address", desired port), call the resquests from files
|
||||
|
||||
|
||||
print("Running @ ",HOST,':',PORT) # Simply outputs on terminal the port that the server is operating
|
||||
httpd.serve_forever() # Method that simply begins listening and responding to incoming requests
|
||||
|
||||
while socketserver == True:
|
||||
listener = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
listener.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
listener.bind((HOST, PORT))
|
||||
listener.listen(1)
|
||||
listener.sendall(httpd)
|
||||
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
_ __ ,---. .-._ _,.---._ ,---.
|
||||
.-`.' ,`..--.' \ /==/ \ .-._ _,..---._ ,-.' , - `. .-.,.---. .--.' \
|
||||
/==/, - \==\-/\ \ |==|, \/ /, /==/, - \ /==/_, , - \ /==/ ` \ \==\-/\ \
|
||||
|==| _ .=. /==/-|_\ | |==|- \| ||==| _ _\==| .=. |==|-, .=., |/==/-|_\ |
|
||||
|==| , '=',\==\, - \ |==| , | -||==| .=. |==|_ : ;=: - |==| '=' /\==\, - \
|
||||
|==|- '..'/==/ - ,| |==| - _ ||==|,| | -|==| , '=' |==|- , .' /==/ - ,|
|
||||
|==|, | /==/- /\ - \|==| /\ , ||==| '=' /\==\ - ,_ /|==|_ . ,'./==/- /\ - \
|
||||
/==/ - | \==\ _.\=\.-'/==/, | |- ||==|-, _`/ '.='. - .' /==/ /\ , )==\ _.\=\.-'
|
||||
`--`---' `--` `--`./ `--``-.`.____.' `--`--'' `--`-`--`--' `--`
|
||||
Loading…
Reference in new issue