torxed / slimhttp Goto Github PK
View Code? Open in Web Editor NEWA minimalistic no-dependencies HTTP server written in Python. Supports: vhosts, REST, WebSocket¹, reverse proxy and static file delivery.
License: GNU General Public License v3.0
A minimalistic no-dependencies HTTP server written in Python. Supports: vhosts, REST, WebSocket¹, reverse proxy and static file delivery.
License: GNU General Public License v3.0
References on the topic:
I'm thinking..
https = slimHTTP.host(slimHTTP.HTTPS | slimHTTP.AUTO_REDIRECT_HTTP)
To indicate that a smaller HTTP
spinner should be brought up, to statically answer everything with 301 Moved Permanently
.
Would be nice if we checked input against specific lengths etc.
For instance:
Traceback (most recent call last):
File "test.py", line 85, in <module>
resposne = client.parse()
File "/home/torxed/github/slimHTTP/slimhttpd.py", line 97, in parse
return http_request(self).parse()
File "/home/torxed/github/slimHTTP/slimhttpd.py", line 243, in parse
method, header = header.split(b'\r\n',1)
ValueError: not enough values to unpack (expected 2, got 1)
Should probably have a sanity check before-hand. Even tho this is never meant to be in a production environment unless it's behind a proper HTTP reverse proxy.
If a vhost
is set to proxy
mode, and where the proxy target/endpoint is 127.0.0.1:443
, slimHTTP will hang indefinitely due to the lack of threads. Since slimHTTP will connect to the proxy (self), and wait for data as it's not part of the main event loop (yet).
Which means that slimHTTP can't process the incoming client request from itself - and thus hang.
the HTTP_PROXY_REQUEST
should be part of the main event poller, although I'm not sure how to wrap it in there just yet.
So for now, let check_config
find and warn/raise an issue when the proxy config points to a listening address/session of itself.
A general lack of error handling, the event pipeline should easily be able to pick issues up and act accordingly.
A good example is f76354d which introduced Transfer-Encoding: chunked
, which allows the server to deliver partial content at a certain interval. If paralell epoll()
events are introduced, that would mean the server doesn't need to "hang" while a large file is being transfered, the individual chunks could be delivered to each user individually, freeing up resources.
We'll have to be careful with RAM management here, as the main reason for slimHTTP is to use as little resources as possible while not sacrificing speed or the flexibility to be deviant in the HTTP world. But would be nice to have paralell tasks so multiple users can browse the resources while still delivering large payloads.
Simplest possible way of creating a proxy pipe some how.
No idea how that would fit in there, but it should definitely override HTTP_REQUEST or something similar into a PROXY_PIPE
or something. That would be the final feature for v1.0 I recon.
A security concern as well as logical concern is that, when a "broken" configuration is given.
The web-root for a particular vhost
will default back to ./
which can lead to unwanted accidents.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.