mirror of https://github.com/kurisufriend/shttpile
parent
152bf9eddd
commit
28c4795078
@ -0,0 +1,15 @@ |
|||||||
|
{ |
||||||
|
// Use IntelliSense to learn about possible attributes. |
||||||
|
// Hover to view descriptions of existing attributes. |
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 |
||||||
|
"version": "0.2.0", |
||||||
|
"configurations": [ |
||||||
|
{ |
||||||
|
"name": "Python: Current File", |
||||||
|
"type": "python", |
||||||
|
"request": "launch", |
||||||
|
"program": "${file}", |
||||||
|
"console": "integratedTerminal" |
||||||
|
} |
||||||
|
] |
||||||
|
} |
@ -1,3 +1,3 @@ |
|||||||
/technically/ standards-compliant http 1.1 server |
soon to be a /technically/ standards-compliant http 1.1 server |
||||||
|
|
||||||
spec'd to RFC 2616 |
spec'd to RFC 2616 |
@ -1,13 +1,16 @@ |
|||||||
import socket |
import socket |
||||||
import response |
import response |
||||||
|
import sys |
||||||
|
import os |
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
||||||
s.bind(("0.0.0.0", 1337)) |
s.bind(("0.0.0.0", 1337)) |
||||||
s.listen() |
s.listen() |
||||||
while True: |
while True: |
||||||
c, c_add = s.accept() |
c, c_add = s.accept() |
||||||
print(c_add) |
print(c_add) |
||||||
print(c.recv(1024).decode("ascii")) |
raw_req = c.recv(2048).decode("ascii") |
||||||
r = response.request.build_response("body.html") |
print(raw_req) |
||||||
|
r = response.request.build_response(response.request.parse(raw_req)) |
||||||
c.sendall(r.text().encode("ascii")) |
c.sendall(r.text().encode("ascii")) |
||||||
c.close() |
c.close() |
||||||
s.close() |
s.close() |
||||||
|
Loading…
Reference in new issue