Asteri: High Performance Python Web Server
Project description
🌟 Asteri Web Server
Asteri adalah web server Python berperforma tinggi, production-ready, yang dirancang dengan sistem argumen CLI yang kaya dan intuitif. Asteri mendukung berbagai protokol mulai dari WSGI, ASGI, hingga uWSGI biner.
✨ Fitur Utama
- Multi-Protokol: HTTP/1.1, HTTP/2 (Full Frame Support), WSGI, ASGI, uWSGI.
- Berbagai Tipe Worker:
sync: Worker sinkron standar.gthread: Worker berbasis thread untuk konkurensi lebih baik.gevent: Worker asinkron berbasis greenlet (performa tinggi).asgi: Dukungan penuh untuk aplikasi modern (FastAPI, Starlette).
- Auto-Reload Profesional: Berbasis event-driven menggunakan
watchdog. - Manajemen Proses: Mode Daemon, PID files, dan User/Group switching.
- Keamanan: Dukungan SSL/TLS (HTTPS) yang mudah dikonfigurasi.
- Dashboard Status: Pantau kesehatan server di endpoint
/asteri-status.
🚀 Instalasi
git clone https://github.com/IshikawaUta/asteri.git
cd asteri
pip install -e .
🛠️ Penggunaan Dasar
Menjalankan aplikasi WSGI:
asteri myapp:app
Menjalankan dengan 4 worker dan bind ke port tertentu:
asteri myapp:app -w 4 -b 0.0.0.0:8080
📖 Panduan CLI Lengkap
Asteri mendukung berbagai kategori argumen untuk kontrol penuh:
🌐 Jaringan (Network)
-b, --bind ADDRESS: Bind ke alamat tertentu (misal:127.0.0.1:8000).--backlog INT: Batas antrean koneksi.--reuse-port: Menggunakan flagSO_REUSEPORTpada soket.
👷 Worker
-w, --workers INT: Jumlah proses worker.-k, --worker-class STRING: Tipe worker (sync,gthread,asgi,gevent).-t, --timeout INT: Batas waktu worker sebelum di-restart.--preload: Memuat aplikasi sebelum forking worker.
🔒 Keamanan & SSL
--certfile FILE: Jalur ke file sertifikat SSL.--keyfile FILE: Jalur ke file kunci SSL.-u, --user USER: Menjalankan worker sebagai user tertentu.-g, --group GROUP: Menjalankan worker sebagai group tertentu.
📝 Logging & Debugging
--log-file FILE: Jalur ke file log error.--log-level LEVEL: Granularitas log (debug,info,warning,error).--access-logfile FILE: Jalur ke file log akses.--print-config: Menampilkan konfigurasi yang sedang digunakan dan keluar.
⚙️ Proses
-D, --daemon: Menjalankan Asteri di latar belakang (background).-p, --pid FILE: Membuat file PID.--reload: Memantau perubahan kode dan memuat ulang worker secara otomatis.--chdir DIR: Mengubah direktori kerja sebelum menjalankan aplikasi.
📄 File Konfigurasi
Anda bisa menggunakan file Python untuk konfigurasi yang lebih kompleks:
# asteri.conf.py
bind = "127.0.0.1:8080"
workers = 4
worker_class = "gthread"
timeout = 60
reload = True
Jalankan dengan: asteri myapp:app -c asteri.conf.py
📊 Dashboard Status
Aktifkan dashboard internal untuk melihat statistik worker:
Kunjungi http://localhost:8000/asteri-status pada browser Anda.
📜 Lisensi
Proyek ini dilisensikan di bawah MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file asteri-1.0.1.tar.gz.
File metadata
- Download URL: asteri-1.0.1.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31a9bb3d1e1d4f7927da1dc9dd5e3cd736f3dd4b53076ef76afbf832fa0893ea
|
|
| MD5 |
7dc22f7522e8c2f4cc5600ff2f3b01e6
|
|
| BLAKE2b-256 |
fb34638692135269e7d28aacbf7a5da8a4de986209aceb9cca75f90f7cb71d5b
|
File details
Details for the file asteri-1.0.1-py3-none-any.whl.
File metadata
- Download URL: asteri-1.0.1-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc3b1f91678e19ddc5b98ff209a28dbe960dce36ffcc8c371b01406dcfca7c44
|
|
| MD5 |
006bd321d5eb88d5b3f8198563445b8f
|
|
| BLAKE2b-256 |
1783d6abbdda033439f73890998ea9e5b8b254a6cd71bf990260d889cddef9fe
|