Matheus 6 years ago
parent 450b96ea14
commit af87cc6cad

@ -1,11 +1,38 @@
#
# _ __ ,---. .-._ _,.---._ ,---.
# .-`.' ,`..--.' \ /==/ \ .-._ _,..---._ ,-.' , - `. .-.,.---. .--.' \
# /==/, - \==\-/\ \ |==|, \/ /, /==/, - \ /==/_, , - \ /==/ ` \ \==\-/\ \
# |==| _ .=. /==/-|_\ | |==|- \| ||==| _ _\==| .=. |==|-, .=., |/==/-|_\ |
# |==| , '=',\==\, - \ |==| , | -||==| .=. |==|_ : ;=: - |==| '=' /\==\, - \
# |==|- '..'/==/ - ,| |==| - _ ||==|,| | -|==| , '=' |==|- , .' /==/ - ,|
# |==|, | /==/- /\ - \|==| /\ , ||==| '=' /\==\ - ,_ /|==|_ . ,'./==/- /\ - \
# /==/ - | \==\ _.\=\.-'/==/, | |- ||==|-, _`/ '.='. - .' /==/ /\ , )==\ _.\=\.-'
# `--`---' `--` `--`./ `--``-.`.____.' `--`--'' `--`-`--`--' `--`
#
# VERSION 0.5
#
# DO NOT USE IT ON PRODUCTION
#
import http.server import http.server
import socketserver import socketserver
import ssl # For future implementation with Openssl import socket
import ssl # For future implementation with Openssl
PORT = 8080 # Define the standard port
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((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
PORT = 8080 # Define the standard port while socketserver == True:
IP = 'localhost' listener = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
Request = http.server.SimpleHTTPRequestHandler # Simple http request handler, it commits all files and directories within the SelfHost.py folder listener.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
listener.bind((HOST, PORT))
listener.listen(1)
listener.sendall(httpd)
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
httpd.serve_forever() # Method that simply begins listening and responding to incoming requests

@ -1,13 +1,23 @@
<!-- Pandora Selfhosted Web Server --> <!-- Pandora Selfhosted Web Server -->
### Pandora Selfhosted _ __ ,---. .-._ _,.---._ ,---.
.-`.' ,`..--.' \ /==/ \ .-._ _,..---._ ,-.' , - `. .-.,.---. .--.' \
/==/, - \==\-/\ \ |==|, \/ /, /==/, - \ /==/_, , - \ /==/ ` \ \==\-/\ \
|==| _ .=. /==/-|_\ | |==|- \| ||==| _ _\==| .=. |==|-, .=., |/==/-|_\ |
|==| , '=',\==\, - \ |==| , | -||==| .=. |==|_ : ;=: - |==| '=' /\==\, - \
|==|- '..'/==/ - ,| |==| - _ ||==|,| | -|==| , '=' |==|- , .' /==/ - ,|
|==|, | /==/- /\ - \|==| /\ , ||==| '=' /\==\ - ,_ /|==|_ . ,'./==/- /\ - \
/==/ - | \==\ _.\=\.-'/==/, | |- ||==|-, _`/ '.='. - .' /==/ /\ , )==\ _.\=\.-'
`--`---' `--` `--`./ `--``-.`.____.' `--`--'' `--`-`--`--' `--`
## Pandora Selfhosted
This project was built with Python 3 and uses basic library to handle files within the Pandora folder, it can access it through localserver and via localhost too. The example files are made with Foundation and shows a very basic usage of the funcionality, and you can use it to learn HTML and CSS without worry about setup a specific server, it's usefull specially if you're still learning. This project was built with Python 3 and uses basic library to handle files within the Pandora folder, it can access it through localserver and via localhost too. The example files are made with Foundation and shows a very basic usage of the funcionality, and you can use it to learn HTML and CSS without worry about setup a specific server, it's usefull specially if you're still learning.
* [Python](https://www.python.org/) * [Python](https://www.python.org/)
* [Foundation](https://get.foundation/index.html) * [Foundation](https://get.foundation/index.html)
<!-- GETTING STARTED --> <!-- GETTING STARTED -->
## Getting Started ### Getting Started
To run and use Pandora, you'll need Python 3 installed on your machine and a modern browser. To run and use Pandora, you'll need Python 3 installed on your machine and a modern browser.
@ -23,6 +33,6 @@ py PandoraRun.py
``` ```
<!-- LICENSE --> <!-- LICENSE -->
## License ### License
Distributed under the MIT License. See `LICENSE` for more information. Distributed under the MIT License. See `LICENSE` for more information.

@ -0,0 +1,9 @@
_ __ ,---. .-._ _,.---._ ,---.
.-`.' ,`..--.' \ /==/ \ .-._ _,..---._ ,-.' , - `. .-.,.---. .--.' \
/==/, - \==\-/\ \ |==|, \/ /, /==/, - \ /==/_, , - \ /==/ ` \ \==\-/\ \
|==| _ .=. /==/-|_\ | |==|- \| ||==| _ _\==| .=. |==|-, .=., |/==/-|_\ |
|==| , '=',\==\, - \ |==| , | -||==| .=. |==|_ : ;=: - |==| '=' /\==\, - \
|==|- '..'/==/ - ,| |==| - _ ||==|,| | -|==| , '=' |==|- , .' /==/ - ,|
|==|, | /==/- /\ - \|==| /\ , ||==| '=' /\==\ - ,_ /|==|_ . ,'./==/- /\ - \
/==/ - | \==\ _.\=\.-'/==/, | |- ||==|-, _`/ '.='. - .' /==/ /\ , )==\ _.\=\.-'
`--`---' `--` `--`./ `--``-.`.____.' `--`--'' `--`-`--`--' `--`
Loading…
Cancel
Save