Socketify.py is a reliable, high-performance Python web framework for building large-scale app backends and microservices.
 
 
 
 
 
 
Go to file
Ciro 9d537a5919 added exception when listen fails, moved some files to ./tests/examples 2022-05-31 16:27:56 -03:00
misc added listen options and SSL support 2022-05-25 10:55:23 -03:00
src/socketify added exception when listen fails, moved some files to ./tests/examples 2022-05-31 16:27:56 -03:00
tests added exception when listen fails, moved some files to ./tests/examples 2022-05-31 16:27:56 -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
README.md updated README.md 2022-05-28 21:00:21 -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
#or in editable mode
pypy3 -m pip install -e git+https://github.com/cirospaciari/socketify.py.git@main#egg=socketify

Install via requirements.txt

requirements.txt file content

git+https://github.com/cirospaciari/socketify.py.git@main#socketify --global-option="build_ext"

install command

pip install -r ./requirements.txt 
#or specify PyPy3
pypy3 -m pip install -r ./requirements.txt 

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 local pip
pypy3 -m pip install . --global-option=build_ext #--no-cache-dir is an option
#install in editable mode
pypy3 -m pip install -e .
#if you want to remove
pypy3 -m pip uninstall socketify