pull/39/head
Ciro 2022-11-08 08:25:54 -03:00
rodzic ed84fbb4d6
commit 364d84312e
1 zmienionych plików z 31 dodań i 14 usunięć

Wyświetl plik

@ -1,15 +1,34 @@
# socketify.py
[![MacOS Build](https://github.com/cirospaciari/socketify.py/actions/workflows/macos.yml/badge.svg)](https://github.com/cirospaciari/socketify.py/actions/workflows/macos.yml)
[![Linux Build](https://github.com/cirospaciari/socketify.py/actions/workflows/linux.yml/badge.svg)](https://github.com/cirospaciari/socketify.py/actions/workflows/linux.yml)
[![Windows Build](https://github.com/cirospaciari/socketify.py/actions/workflows/windows.yml/badge.svg)](https://github.com/cirospaciari/socketify.py/actions/workflows/windows.yml)
Fast WebSocket and Http/Https server using CFFI with C API from [uNetworking/uWebSockets](https://github.com/uNetworking/uWebSockets)
This project aims at High Performance PyPy3 Web Development and WebSockets
<p align="center">
<a href="https://github.com/cirospaciari/socketify.py"><img src=" https://raw.githubusercontent.com/cirospaciari/socketify.py/main/misc/logo.png" alt="Logo" height=170></a>
<br />
<br />
<a href="https://github.com/cirospaciari/socketify.py/actions/workflows/macos.yml" target="_blank"><img src="https://github.com/cirospaciari/socketify.py/actions/workflows/macos.yml/badge.svg" /></a>
<a href="https://github.com/cirospaciari/socketify.py/actions/workflows/linux.yml" target="_blank"><img src="https://github.com/cirospaciari/socketify.py/actions/workflows/linux.yml/badge.svg" /></a>
<a href="https://github.com/cirospaciari/socketify.py/actions/workflows/windows.yml" target="_blank"><img src="https://github.com/cirospaciari/socketify.py/actions/workflows/windows.yml/badge.svg" /></a>
</p>
> This project will adapt the full C API from uNetworking/uWebSockets, this same C API is used by [Bun](https://bun.sh/)
### Overly simple hello world app [click here](https://github.com/cirospaciari/socketify.py/tree/main/examples) for more examples
socketify.py brings:
- WebSocket with pub/sub support
- Fast and realiable Http/Https
- Support for Windows, Linux and macOS Silicon & x64
- Support for [`PyPy3`](https://www.pypy.org/) and [`CPython`](https://github.com/python/cpython)
This project aims to bring high performance PyPy3 web development and will bring:
- fetch like API powered by libuv
- async file IO powered by libuv
- full asyncio integration with libuv
We adapt the full C API from uNetworking/uWebSockets and integrate libuv powered fetch and file IO, this same C API is used by [Bun](https://bun.sh/)
Overly simple hello world app [click here](https://github.com/cirospaciari/socketify.py/tree/main/examples) for more examples
```python
from socketify import App
@ -19,8 +38,7 @@ app.listen(3000, lambda config: print("Listening on port http://localhost:%d now
app.run()
```
### pip install
pip install
```bash
pip install git+https://github.com/cirospaciari/socketify.py.git
@ -30,21 +48,20 @@ pypy3 -m pip install git+https://github.com/cirospaciari/socketify.py.git
pypy3 -m pip install -e git+https://github.com/cirospaciari/socketify.py.git@main#egg=socketify
```
### Install via requirements.txt
requirements.txt
requirements.txt file content
```text
git+https://github.com/cirospaciari/socketify.py.git@main#socketify
```
install command
install via requirements.txt
```bash
pip install -r ./requirements.txt
#or specify PyPy3
pypy3 -m pip install -r ./requirements.txt
```
### SSL version sample
SSL version sample
``` python
from socketify import App, AppOptions
@ -54,7 +71,7 @@ app.listen(3000, lambda config: print("Listening on port http://localhost:%d now
app.run()
```
### Build local from source
Build local from source
```bash
#clone and update submodules
git clone https://github.com/cirospaciari/socketify.py.git