This is a basic implementation of an ASGI (Asynchronous Server Gateway Interface) web server in Python. It is intended for learning purposes only and should not be used in a production environment.
ASGI is a standard interface between web servers and Python web applications or frameworks. Here are some useful resources to learn more about the ASGI specification:
You can test the functionality of this web server by using the following endpoints:
- GET request:
curl -X GET -H "Content-Type: application/json" -d '{"name": "john"}' "http://0.0.0.0:8000/?suffix=\!\!"
- OPTIONS request:
curl -X OPTIONS -H "Content-Type: application/json" -H "Access-Control-Request-Method: GET" -H "Origin: http://0.0.0.0:8000" -d '{"name": "john"}' "http://0.0.0.0:8000/?suffix=\!\!"
The web server currently supports the following features:
- Handling GET requests
- Handling OPTIONS requests
- Supporting HEAD requests
- Supporting ASGI lifespan start/complete events
- Basic support for multiple worker processes
- Support for POST and DELETE requests (work in progress)
- Support for keep-alive connections (pending)
- Support for Server-Sent Events (SSE) (pending)
- Support for chunked request and response (pending)
Contributions to this project are welcome. If you want to contribute, please follow the standard open-source practices for submitting pull requests.
This project is licensed under the MIT License. Feel free to use and modify it for your own purposes.