Socketify.py is a reliable, high-performance Python web framework for building large-scale app backends and microservices.
 
 
 
 
 
 
Go to file
Ciro 4e728ccaf0 fix modules?? 2022-05-28 20:18:31 -03:00
misc added listen options and SSL support 2022-05-25 10:55:23 -03:00
src/socketify fix modules?? 2022-05-28 20:18:31 -03:00
tests added local build in README 2022-05-28 17:04:35 -03:00
.gitignore fix modules?? 2022-05-28 20:18:31 -03:00
.gitmodules fix modules?? 2022-05-28 20:18:31 -03:00
LICENSE Initial commit 2022-05-24 16:29:51 -03:00
README.md try to fix pypy build 2022-05-28 19:49:16 -03:00
setup.py try to fix pypy build 2022-05-28 19:49:16 -03:00

README.md

socketify.py

Fast WebSocket and Http/Https server using CFFI with C API from uNetworking/uWebSockets

This project will adapt the full capi from uNetworking/uWebSockets but for now it's just this.

Overly simple hello world app

from socketify import App

app = App()
app.get("/", lambda res, req: res.end("Hello World socketify from Python!"))
app.listen(3000, lambda config: print("Listening on port http://localhost:%d now\n" % config.port))
app.run()

pip install

pip install git+https://github.com/cirospaciari/socketify.py.git --global-option=build_ext
#or specify PyPy3
pypy3 -m pip install git+https://github.com/cirospaciari/socketify.py.git --global-option=build_ext

Run

pypy3 ./hello_world.py

SSL version sample

from socketify import App, AppOptions

app = App(AppOptions(key_file_name="./misc/key.pem", cert_file_name="./misc/cert.pem", passphrase="1234"))
app.get("/", lambda res, req: res.end("Hello World socketify from Python!"))
app.listen(3000, lambda config: print("Listening on port http://localhost:%d now\n" % config.port))
app.run()

Build local from source

#clone and update submodules
git clone https://github.com/cirospaciari/socketify.py.git
cd ./socketify.py
git submodule update --init --recursive --remote
#install build with pip
pypy3 -m pip install --upgrade build
#build and install
pypy3 -m build
pypy3 -m pip install . --no-cache-dir --global-option=build_ext
#if you want to remove
pypy3 -m pip uninstall socketify