Skip to content

Commit 36221f0

Browse files
authored
Add files via upload
1 parent df1fec8 commit 36221f0

File tree

2 files changed

+103
-0
lines changed

2 files changed

+103
-0
lines changed

index.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
<html style="font-size: 16px;">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>HTTP - Ñåðâåð</title>
6+
<style>
7+
h1 {
8+
color: #080950;
9+
font-size: 200%;
10+
font-family: monospace;
11+
}
12+
p {
13+
color: #080950;
14+
font-size: 100%;
15+
font-family: monospace;
16+
}
17+
</style>
18+
</head>
19+
<body>
20+
<h1>ñåðâåð</h1>
21+
<p>http</p>
22+
</body>
23+
</html>

servhttp.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
from http.server import HTTPServer, BaseHTTPRequestHandler
2+
import codecs, time
3+
4+
5+
class Server(BaseHTTPRequestHandler):
6+
def do_GET(self):
7+
if self.path == '/':
8+
self.path = '/index.html', "/nicepage.css" , "/nicepage.js" , "/jquery.js" , "/glavn.html" , "/glavn.css" , "/images/photo.png", "/photo.png"
9+
try:
10+
file_to_open = codecs.open(self.path[1:], "r", "UTF-8").read()
11+
self.send_response(200)
12+
try:
13+
self.end_headers()
14+
self.wfile.write(bytes(file_to_open, "UTF-8"))
15+
except AttributeError:
16+
pass
17+
except UnicodeDecodeError:
18+
pass
19+
except UnboundLocalError:
20+
pass
21+
except:
22+
file_to_open = "File not found"
23+
self.send_response(404)
24+
def siteFunc():
25+
host = "192.168.0.106"
26+
print("---------------------------INSTRUCTIONS---------------------------\n" +
27+
"How to find out ipv4? - Open a command line \nand then write ipconfig then look for the ipv4 entry of your network!\n" +
28+
"The server does not start! Open port 55555 on your router! \nGoogle how to do it!\n" +
29+
"Then this application will do everything for you!\nProvided that you download all the necessary libraries!\n" +
30+
"---------------------------INSTRUCTIONS---------------------------\n")
31+
host = input("ENTER THE IPv4 ADDRESS OF YOUR COMPUTER:")
32+
httpd = HTTPServer((host, 55555), Server)
33+
print("" +
34+
" ____ _____ ______ _______ ____ ____ _____ _ ____ _____ _____ ____ \n" +
35+
" / ___|| ____| _ \ \ / / ____| _ \ / ___|_ _|/ \ | _ \_ _| ____| _ \ \n" +
36+
" \___ \| _| | |_) \ \ / /| _| | |_) | \___ \ | | / _ \ | |_) || | | _| | | | | \n" +
37+
" ___) | |___| _ < \ V / | |___| _ < ___) || |/ ___ \| _ < | | | |___| |_| | \n" +
38+
" |____/|_____|_| \_\ \_/ |_____|_| \_\ |____/ |_/_/ \_\_| \_\|_| |_____|____/ \n" +
39+
"\n" +
40+
" PYTHON HTTP HOSTING SERVER >>> by srgwrtg0342"
41+
)
42+
print("LOGS>>>>")
43+
time.sleep(0.09)
44+
print("INFO: MEMORY ALLOCATION")
45+
print("INFO: PRE-INITIALIZATION CODE VERIFICATION")
46+
print("INFO: INITIALIZATION OF CODE CHECK")
47+
print("INFO: SUCCESSFUL CODE VERIFICATION")
48+
print("INFO: BINDER INITIALIZATION")
49+
print("INFO: PRE-INITIALIZING PREPARATION FOR LAUNCHING THE SERVER")
50+
time.sleep(0.2)
51+
print("INFO: PRE-INITIALIZING ERROR CORRECTION")
52+
print("INFO: ERROR REPORTING")
53+
print("INFO: SOLUTION OF ERRORS ACCORDING TO THE REPORT")
54+
time.sleep(0.1)
55+
print("INFO: INSTALLING PRE-INITIALIZATION RESOURCES")
56+
print("INFO: MORE MEMORY ALLOCATION")
57+
print("INFO: OPTIMIZED USE")
58+
print("INFO: COMPLETION OF THE APP BUILDING - NEXT SERVER")
59+
time.sleep(0.05)
60+
print("INFO: SERVER PRE-INITIALIZATION")
61+
print("INFO: INITIALIZATION PREPARATION")
62+
print("INFO: INITIALIZING EXTENSIONS")
63+
print("INFO: INITIALIZING THE KERNEL")
64+
time.sleep(0.1)
65+
print("INFO: PREPARATION FOR INSTALLATION")
66+
print("INFO: INSTALLING HTML")
67+
print("INFO: INSTALLING CSS")
68+
time.sleep(0.25)
69+
print("INFO: INSTALLING JS")
70+
print("INFO: INITIALIZING THE SERVER CORE")
71+
print("INFO: SERVER INITIALIZATION")
72+
time.sleep(0.1)
73+
print("INFO: PRE-BIND SERVER")
74+
print("INFO: SERVER BINDING...")
75+
print("INFO: SERVER BINDED!")
76+
time.sleep(0.1)
77+
print("Http server on - http://",host,":55555/index.html (url without spaces)")
78+
httpd.serve_forever()
79+
80+
siteFunc()

0 commit comments

Comments
 (0)