Ahui-aiohttp-server
This is a simple http async server which extends python -m http.server.
(WARN: It's not recommended for production environments, just use it in development or testing environments only!):
- Support print to http response directly (same as php's echo)
- Support async-await
- Support php, python
Install
pip install ahui-aiohttp-server
pip3 install ahui-aiohttp-server
Start server
$ tree .
./
app/
echo1.py
echo2.py
echo.php
return.py
js/
test.js
$ python -m ahui_aiohttp_server
$ python -m ahui_aiohttp_server --host 127.0.0.1 --port 5000
Access server
Access via echo server(php-like):
$ cat app/echo1.py
print('Hello World!')
$ curl http://127.0.0.1:5000/app/echo1.py
Hello World!
$ curl http://127.0.0.1:5000/js/test.js
<js content>
$ curl http://127.0.0.1:5000/app/echo.php
<js content>
If you want to get request data(such as: get, post, cookie, ..., use aiohttp_handler(request) instead:
$ cat app/echo2.py
def aiohttp_handler(request):
print(request.query) # use print
$ curl http://127.0.0.1:5000/app/echo2.py?var=value
{'var':'value'}
Access via normal aiohttp server:
$ cat app/return.py
from aiohttp import web
async def aiohttp_handler(request):
data = await request.post()
return web.Response(body=str(data)) # use return
$ curl http://127.0.0.1:5000/app/return.py?var=value - 'k1=v2'
{'k1':'v2'}
Access static file:
$ curl http://127.0.0.1:5000/js/test.js
<js content>
Required
- aiohttp
- python>=3.6
Metadata
Release files for ahui_aiohttp_server 0.1.16
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ahui_aiohttp_server-0.1.16.tar.gz | 3.2 kB | Without provenance | Details for ahui_aiohttp_server-0.1.16.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ahui_aiohttp_server-0.1.16-py3-none-any.whl | Python 3 | none | any | Details for ahui_aiohttp_server-0.1.16-py3-none-any.whl |
Total release size: 6.4 kB
Release files / ahui_aiohttp_server-0.1.16.tar.gz
| Download URL | ahui_aiohttp_server-0.1.16.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fb61a19d054b07c4569dcea1d285624c5960e0caee2041a16ad4059d23876328
|
|
BLAKE2b-256 checksum How to use checksums |
86b91750cf3a1b4a82a47685c1f4d1c759a04db4e68fc81e6032e74d9a67a0a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.18.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.1
|
Release files / ahui_aiohttp_server-0.1.16-py3-none-any.whl
| Download URL | ahui_aiohttp_server-0.1.16-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f20de21c582cacb4a82da4cc89700efdd265d4fef216d39866d3c4c9f06aa8b6
|
|
BLAKE2b-256 checksum How to use checksums |
4b81088b78014828b250d3874e10c90c158166b82a495568b5fd12f9e312b010
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.18.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.1
|
Security for ahui_aiohttp_server 0.1.16
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.