Skip to content

ASGI server which can run ASGI compatible application server like FastAPI

License

Notifications You must be signed in to change notification settings

joeljacobdev/unicorn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unicorn

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 Spec

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:

How to Use

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=\!\!"

Features

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)

Contribution

Contributions to this project are welcome. If you want to contribute, please follow the standard open-source practices for submitting pull requests.

License

This project is licensed under the MIT License. Feel free to use and modify it for your own purposes.

About

ASGI server which can run ASGI compatible application server like FastAPI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages