Releases: Torxed/slimHTTP
v1.0.1rc7
Minor fixes
- Tweaked the error handling a bit
- Condensed the
.py
support into one class calledImported()
to centralize the handling of absolute imports via paths - Made it so that both
proxy
andmodule
modes breaks the execution flow if present, ensures that #8 doesn't happen (hopefully). - Cleaned up some iterator logic (mismatch between how objects were yielded up the chain)
- Fixed the
Content-Range
logic, as it was broken
v1.0.1rc6
New features
- Added support for
Transport-Encoding: chunked
(Chunked transfers for large files viaSTREAM_CHUNKED
class file delivery)
Minor fixes
- Moved
run()
logic to HTTP base class instead of HTTPS. - Fixed websocket
Upgrade
logic a bit - Added some more data events and restructured them a bit
- Added a JSON serializer
- Fixed VHOST definition/cofinfugration some times referencing the default config
v1.0.1rc5
New features:
- Reverse proxy support (with optional flag for TLS) which fixes #7
CLIENT_RESPONSE_PROXY_DATA
event for whenever response data comes from a proxy, and not slimHTTP directly.- The index file
/<index file>
is no longer automatically appended for any request that ends with/
, it's only done on static file delivery mode. Meaning@.route('/')
will not become@.route('/index.html')
before calling the route function. (was actually fixed in the previous rc4 but not mentioned properly)
v1.0.1rc4
New features:
module
mode forvhosts
added.proxy
mode stub function added to make it easier to implement in the future.- A more complete documentation has been added.
Fixes
index
logic moved to not interfere with the modules etc.
v1.0.1rc3-1
New features:
-
vhost
in configuration now supports one new (and one stub) function. if avhost
configuration contains"module" : "/path/script.py"
, that script will be imported and executed upon each request (no caching for now). It has two "lookups" in terms of module function, one beingon_request
which will be used as the default for each request to thatvhost
. Unless@slimHTTP.instances['addr:port'].route('/', vhost='example.com')
is specified, which will override the default handleron_request
. If none of the two are found, the module is simply just executed as-is and whatever is in there will act as a normal Python script. -
HTTPS support - better late than never. HTTPS is tested without
PyOpenSSL
which is an optional enhancement to slimHTTP. Mockup function to simulate the function calls toPyOpenSSL
has been created, so a direct replacement ofssl
toPyOpenSSL.SSL
should be possible. -
index_file
no longer have precedence over@app.route
definitions, those definitions there for no longer require/index.html
at the end, and routes can be either@app.route('/')
or@app.route('/index.html')
- but the later will not be auto-redirected if the client doesn't specify it.
Fixes
This commit also addresses issue #8. But extensive testing hasn't been done.
v1.0.1rc1
New feature: large payloads
Some new features:
- Support for large HTTP payloads (thanks to self sacrificing
HTTP_REQUEST
) - New example using discord.py integrated with slimHTTP to form a unison. So showcase the use of slimHTTP together with other libraries mainly using
asyncio
. Altho slimHTTP isn't asyncio in the traditional sense since it's thread safe, it works together with those libraries as well. Events.convert()
which can convert an event INT to a readable string. (Kinda crude but it works, I'm pretty sure heh)HTTP_RESPONSE.build()
now tries to accurately read theContent-Type
in order to semi-parse the responding data and transform it intobytes
in a non-intrusive way if possible. (No errorhandling here yet tho..)HTTP_SERVER
now supportsaddr = :str
andport = :int
parameters instead ofconfig = :dict
, as these variables are needed pre-startup in order to spin up thesocket.bind()
operation and can there for not wait for@http.configuration
handler being set up.
Minor fixes:
HTTP_REQUEST.request_payload
have no changed name toHTTP_REQUEST.payload
, same goes forHTTP_REQUEST.headers
.- A new event to support partially received content:
Events.CLIENT_DATA_FRAGMENTED
- Proper (?) termination of HTTP requests, as the server some times forgot to close sockets properly and delete them from the
self.pollobj
. - Added some more documentation
v1.0-beta.001
First stable beta release candidate of the minimal web server.
There's some kinks to be sorted out and probably a lot of unknowns, but this release seams to work in a basic sense with a few bug fixes since the alpha release.
v1.0-alpha
Usage is simple enough that it's time to release a v1.0.
It supports most basic needs, but for sure not all of them.
Tested integration with spiderWeb who's name I should probably rename.
Some key milestones:
- Cross platform support (sounds silly, but the use of
select.epoll()
made this tricky) - Works great with WebSockets thanks to spiderWeb
- REST lookalike behavior (ignores headers, just checks the path/url)
- Response headers are a bit easier to set with:
@http.route('/hellowWorld.html')
def api_helloWorld(request):
return slimhttpd.HTTP_RESPONSE(headers={'Content-Type' : 'text/html'},
payload=b'<html><body>Test</body></html>')
Auto-generation of self signed certificates have been prepared, but not yet fully turned on. And there's a bunch of tests that has to be done prior to an actual release party.