Giter Site home page Giter Site logo

cirospaciari / socketify.py Goto Github PK

View Code? Open in Web Editor NEW
1.3K 21.0 47.0 37.66 MB

Bringing Http/Https and WebSockets High Performance servers for PyPy3 and Python3

Home Page: https://www.socketify.dev

License: MIT License

Python 86.43% Makefile 2.53% C 1.72% C++ 7.09% Batchfile 0.34% JavaScript 1.80% Shell 0.10%
python pypy python3 commercial http proxy-protocol pubsub router websockets asyncio

socketify.py's Introduction

socketify.py

Logo


GitHub Clones PyPI Downloads Discord

Documentation   •   Discord   •   Issues   •   Examples

💡 Features

  • WebSocket with pub/sub support
  • Fast and reliable Http/Https
  • Support for Windows, Linux and macOS Silicon & x64
  • Support for PyPy3 and CPython
  • Dynamic URL Routing with Wildcard & Parameter support
  • Sync and Async Function Support
  • Really Simple API
  • Fast and Encrypted TLS 1.3 quicker than most alternative servers can do even unencrypted, cleartext messaging
  • Per-SNI HttpRouter Support
  • Proxy Protocol v2
  • Shared or Dedicated Compression Support
  • Max Backpressure, Max Timeout, Max Payload and Idle Timeout Support
  • Automatic Ping / Pong Support
  • Per Socket Data
  • Middlewares
  • Templates Support (examples with Mako and Jinja2)
  • ASGI Server
  • WSGI Server
  • Plugins/Extensions

🔎 Upcoming Features

  • In-Memory Cache Tools
  • Fetch like API powered by libuv
  • Async file IO powered by libuv
  • Full asyncio integration with libuv
  • SSGI Server spec and support
  • RSGI Server support
  • Full Http3 support
  • HPy integration to better support CPython, PyPy and GraalPython
  • Hot Reloading

We created and adapted the full C API from uNetworking/uWebSockets and will integrate libuv powered fetch and file IO, this same C API is used by Bun

Join Github Discussions or Discord for help and have a look at the development progress.

⚡ Benchmarks

Socketify WebFramework HTTP requests per second (Linux x64)

image

WSGI Server requests per second (Linux x64)

image

ASGI Server requests per second (Linux x64)

image

WebSocket messages per second (Linux x64)

image

Http tested with TFB tool plaintext benchmark
WebSocket tested with Bun.sh bench chat-client
Source code in TechEmPower and for websockets in bench

Machine OS: Debian GNU/Linux bookworm/sid x86_64 Kernel: 6.0.0-2-amd64 CPU: Intel i7-7700HQ (8) @ 3.800GHz Memory: 32066MiB

📦 Installation

For macOS x64 & Silicon, Linux x64, Windows

pip install socketify
#or specify PyPy3
pypy3 -m pip install socketify
#or in editable mode
pypy3 -m pip install -e socketify

Using install via requirements.txt

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

If you are using linux or macOS, you may need to install libuv and zlib in your system

macOS

brew install libuv
brew install zlib

Linux (Ubuntu/Debian)

apt install libuv1 zlib1g

Linux (RHEL/OEL)

yum install cmake zlib-devel libuv-devel

🤔 Usage

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()

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()

WebSockets

from socketify import App, OpCode, CompressOptions

def ws_open(ws):
    print('A WebSocket got connected!')
    ws.send("Hello World!", OpCode.TEXT)

def ws_message(ws, message, opcode):
    #Ok is false if backpressure was built up, wait for drain
    ok = ws.send(message, opcode)
    
app = App()    
app.ws("/*", {
    'compression': CompressOptions.SHARED_COMPRESSOR,
    'max_payload_length': 16 * 1024 * 1024,
    'idle_timeout': 12,
    'open': ws_open,
    'message': ws_message,
    'drain': lambda ws: print(f'WebSocket backpressure: {ws.get_buffered_amount()}'),
    'close': lambda ws, code, message: print('WebSocket closed'),
    'subscription': lambda ws, topic, subscriptions, subscriptions_before: print(f'subscribe/unsubscribe on topic {topic} {subscriptions} {subscriptions_before}'),
})
app.any("/", lambda res,req: res.end("Nothing to see here!'"))
app.listen(3000, lambda config: print("Listening on port http://localhost:%d now\n" % (config.port)))
app.run()

We have more than 20 examples click here for more

🔨 Building from source

#clone and update submodules
git clone https://github.com/cirospaciari/socketify.py.git
cd ./socketify.py
git submodule update --init --recursive --remote
#you can use make linux, make macos or call Make.bat from Visual Studio Development Prompt to build
cd ./src/socketify/native/ && make linux && cd ../../../
#install local pip
pypy3 -m pip install .
#install in editable mode
pypy3 -m pip install -e .
#if you want to remove
pypy3 -m pip uninstall socketify

💼 Commercially supported

I'm a Brazilian consulting & contracting company dealing with anything related with socketify.py and socketify.rb

Don't hesitate sending a mail if you are in need of advice, support, or having other business inquiries in mind. We'll figure out what's best for both parties.

Special thank's to uNetworking AB to develop uWebSockets, uSockets and allow us to bring this features and performance to Python and PyPy

❤️ Sponsors

If you like to see this project thrive, you can sponsor us on GitHub too. We need all the help we can get.

Thank you Otavio Augusto to be the first sponsor of this project!

⭐ Stargazers

Stargazers repo roster for @cirospaciari/socketify.py

🔧 Forkers

Forkers repo roster for @cirospaciari/socketify.py

❔ uvloop

We don't use uvloop, because uvloop don't support Windows and PyPy3 at this moment, this can change in the future, but right now we want to implement our own libuv + asyncio solution, and a lot more.

💫 CFFI vs Cython vs HPy

Cython performs really well on Python3 but really bad on PyPy3, CFFI are chosen for better support PyPy3 until we got our hands on a stable HPy integration.

socketify.py's People

Contributors

amirhmzz avatar cirospaciari avatar cirowecontent avatar cofin avatar domoritz avatar i404788 avatar kianmeng avatar lazarovziv avatar mikesway avatar tcarreira avatar wrieg123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

socketify.py's Issues

windows unable to install

Describe the bug
missing libsocketify_windows_amd64.dll

PS C:\repos> pip install git+https://github.com/cirospaciari/socketify.py.git
Collecting git+https://github.com/cirospaciari/socketify.py.git
  Cloning https://github.com/cirospaciari/socketify.py.git to c:\users\j\appdata\local\temp\pip-req-build-kpb0nw3_
  Running command git clone --filter=blob:none --quiet https://github.com/cirospaciari/socketify.py.git 'C:\Users\j\AppData\Local\Temp\pip-req-build-kpb0nw3_'
  Resolved https://github.com/cirospaciari/socketify.py.git to commit 594e5b8474a5d7cb8e7c6aa29fb150017f69ddb9
  Running command git submodule update --init --recursive -q
  Preparing metadata (setup.py) ... done
Requirement already satisfied: cffi>=1.0.0 in c:\users\j\appdata\local\programs\python\python39\lib\site-packages (from socketify==0.0.1) (1.14.5)
Collecting setuptools>=58.1.0
  Downloading setuptools-65.6.0-py3-none-any.whl (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 7.1 MB/s eta 0:00:00Requirement already satisfied: pycparser in c:\users\j\appdata\local\programs\python\python39\lib\site-packages (from cffi>=1.0.0->socketify==0.0.1) (2.20)
Building wheels for collected packages: socketify
  Building wheel for socketify (setup.py) ... done
  Created wheel for socketify: filename=socketify-0.0.1-cp39-cp39-win_amd64.whl size=3230911 sha256=7750e1c48021342a7361da4c87c1d5ac3c9389b22c4085a6fbc216c2245c72a6
  Stored in directory: C:\Users\j\AppData\Local\Temp\pip-ephem-wheel-cache-ozbggtdg\wheels\ea\5e\75\6917b42888d8f701be2bcb306f24a5a275989a293b3194846c
  Attempting uninstall: setuptools
    Found existing installation: setuptools 56.0.0
    Uninstalling setuptools-56.0.0:
      Successfully uninstalled setuptools-56.0.0
Successfully installed setuptools-65.6.0 socketify-0.0.1

PS C:\repos\pubsub> python .\server.py
Traceback (most recent call last):
  File "C:\repos\pubsub\server.py", line 2, in <module>
    from socketify import App, AppOptions, OpCode, CompressOptions
  File "C:\Users\j\AppData\Local\Programs\Python\Python39\lib\site-packages\socketify\__init__.py", line 1, in <module>
    from .socketify import (
  File "C:\Users\j\AppData\Local\Programs\Python\Python39\lib\site-packages\socketify\socketify.py", line 16, in <module>
    from .loop import Loop
  File "C:\Users\j\AppData\Local\Programs\Python\Python39\lib\site-packages\socketify\loop.py", line 5, in <module>
    from .uv import UVLoop
  File "C:\Users\j\AppData\Local\Programs\Python\Python39\lib\site-packages\socketify\uv.py", line 70, in <module>
    lib = ffi.dlopen(library_path)
  File "C:\Users\j\AppData\Local\Programs\Python\Python39\lib\site-packages\cffi\api.py", line 150, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
  File "C:\Users\j\AppData\Local\Programs\Python\Python39\lib\site-packages\cffi\api.py", line 832, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
  File "C:\Users\j\AppData\Local\Programs\Python\Python39\lib\site-packages\cffi\api.py", line 827, in _load_backend_lib
    raise OSError(msg)
OSError: cannot load library 'C:\Users\j\AppData\Local\Programs\Python\Python39\lib\site-packages\socketify\libsocketify_windows_amd64.dll': error 0x7e.  Additionally, ctypes.util.find_library() did not manage to locate a library called 'C:\\Users\\j\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\socketify\\libsocketify_windows_amd64.dll'

Desktop (please complete the following information):

  • OS: Windows 10

Add more developer-friendly WebSocket Interface

Is your feature request related to a problem? Please describe.

Currently, Socketify uses a method of using the open, message, and close indicators to show parse the obvious. This makes it much harder to track and sustain a connection easily.

Describe the solution you'd like

I would like an implementation to something like what the WebSockets library has, and what most other libraries do:

async def websocket_handler(ws: socketify.WebSocket) -> None:
    await user_online()

    # stops looping on close
    async for msg in ws:
       await ws.send('hey!')

    await user_offline()

app.ws('/websocket', {
    'compression': CompressOptions.SHARED_COMPRESSOR,
    'max_payload_length': 16 * 1024 * 1024,
    'idle_timeout': 12,
    'handler': websocket_handler,
    'drain': lambda ws: print('WebSocket backpressure: %i' % ws.get_buffered_amount()),
})

This would be optional, and not required to use websockets. It'd also make it much easier to keep state if, per se, you're trying to make a chat app or another similar thing which requires state and easy DX.

else then all of that though, I'd just like to say that this project is really nice, I've always been looking for a fast Python websocket lib and I think this one is a first, I can't wait to see this library be production-ready!

LRU Cache and Timed Cache avoiding GIL a in memory cache solution

Add cache options, LRU with maxsize or Cache with duration. When cached headers, status code and body should be cached on C++ and never touch Python again when cached.

Should be implemented after the router decorator: #59

from socketify import App
app = App()
router = app.router()

@router.get("/lru", lru_cache=128) #If LRU True default value is set (128)
def lru(res, req):
   res.end("Hello World!")

router = app.router(lru_cache=128)
@router.get("/lru_2") #If LRU is passed on router, so any route of this router is cached with lru
def lru2(res, req):
   res.end("Hello World!")

@router.get("/cache", cache=30) #If cache is provided the expiration will be in seconds (30s in this cache)
def cache2(res, req):
   res.end("Hello World!")


router = app.router(cache=30, cache_ignores_query=True) # cache_ignores_query default is False
@router.get("/cache2") #If Cache is passed on router, so any route of this router is cached with cache
def cache2(res, req):
   res.end("Hello World!")
   
 # cache, lru_cache and cache_ignores_query should be available in the app router and MiddlewareRouter too
app.get("/test", lambda res, req: res.end("xablau"), cache=30)

Cache should synchronize all requests (only 1 request should be processed at a time, all other requests are queued and responded to with the cached content)
Cache should use URL or fullurl and be route independent (get/post/any etc)

  • Create LRU Cache system using C++
  • Create Timed Cache System using C++ and libuv
  • Support cache_ignores_query in LRU and Timed Cache
  • Support cache helper in the default Router
  • Support cache helper in MiddlewareRouter
  • Support cache helper in decorator routers
  • Create Documentation

Fetch like API using uSockets

Create a fetch-like API using uSockets, and try to reuse HTTP parser from uWebsockets. Something like Bun did but in C/C++.

https://github.com/uNetworking/uWebSockets/blob/master/src/MessageParser.h
https://github.com/uNetworking/uWebSockets/blob/master/src/QueryParser.h
https://github.com/uNetworking/uWebSockets/blob/master/src/HttpParser.h
https://github.com/uNetworking/uWebSockets/blob/master/src/ProxyParser.h

https://fetch.spec.whatwg.org/#http-fetch

benchmark against
https://github.com/h2o/picohttpparser

import json
from socketify import fetch

options = { 
 'method': 'POST', 
 'headers': {
    'Content-Type': 'application/json',
  },
  'body': json.dumps(data).encode("utf-8")
}
response = await fetch("https://example.com/profile", options).json()
print(response)

response = await fetch("http://example.com/movies.json").text()
print(response)

should be on par with aiohttp

  • Create Linux version
  • Create Windows build
  • Create MacOS and MacOS arm64 build
  • Benchmarking
  • Create Documentation

Pub/Sub Example?

Hello, it seems that this lib supports pub/sub but I have not clue how to handle it?
is it there some example?

Add server name functions integration

void uws_remove_server_name(int ssl, uws_app_t *app, const char *hostname_pattern);
void uws_add_server_name(int ssl, uws_app_t *app, const char *hostname_pattern);
void uws_add_server_name_with_options(int ssl, uws_app_t *app, const char *hostname_pattern, struct us_socket_context_options_t options);
void uws_missing_server_name(int ssl, uws_app_t *app, uws_missing_server_handler handler, void *user_data);
void uws_filter(int ssl, uws_app_t *app, uws_filter_handler handler, void *user_data);

Implement WebSocket Client

uWebSockets don't provide an Client, we need todo one from scratch in C/C++ and integrate using uWebSockets/uSockets

Benchmark question

Hi there,

Do you perhaps have the packages installed on the benchmark you performed?

Add request, response and WS extensions

Users should be able to extend request, response and WS objects by adding methods and properties to it

def extension(request, response, ws):

    @request.method
    async def get_user(self):
        token = self.get_header("token")
        self.token = token
        return { "name": "Test" } if token else { "name", "Anonymous" }

    @request.method
    async def get_cart(self):
        return [{ "quantity": 10, "name": "T-Shirt" }]

    request.property("token", None)

app.register(extension)

Object Factories should be optimized for it.

Extensions options should be done by using High Order Functions:

def MyExtension(options):
  def extension(request, response, ws):

      @request.method
      async def get_user(self):
          token = self.get_header("token")
          self.token = token
          return { "name": "Test" } if token else { "name", "Anonymous" }

      @request.method
      async def get_cart(self):
          return [{ "quantity": 10, "name": "T-Shirt" }]

      request.property("token", None)
   return extension

app.register(MyExtension(options))
  • Implement request extensions
  • Implement response extension
  • Implements ws extensions
  • Add Documentation

Add hot reloading on CLI Tools

Should not add any dependencies, should use libuv to watch files.

 --static-files-dir PATH                             Enable static file server on this directory. You can also provide ROUTE:PATH ex: /assets:./public to say in what HTTP path route you wanna serve the files, default ROUTE is /.
 --reload                                            Enable auto-reload. These options also disable the --workers or -w options.
 --reload-dir PATH                                   Set reload directories explicitly, instead of using the current working directory.
 --reload-include TEXT                               Set extensions to include while watching for files. 
                                                     Includes '.py,.html,.js,.png,.jpeg,.jpg and .webp' by default; 
                                                     these defaults can be overridden with `--reload-exclude`. 
 --reload-exclude TEXT                               Set extensions to include while watching for files. 
 --reload-delay INT                                  Milliseconds to delay reload between file changes. [default: 1000]

Should allow multiple --reload-dir and --static-files-dir.

Better ASGI and WSGI documentation

  • Write Full ASGI documentation including pub/sub extensions and how to use them
  • Write Full WSGI documentation
  • Link documentation on README

Architecture Page with Reference to corking process/procedure/concept

Long C/C++ term developer (44 years) with only 2 years professional Python experience...

I am unfamiliar with this "corking" concept, web searching leads me to an authentication library for the Bottle Framework. https://cork.readthedocs.io/en/latest/

Can a reference to this specific "Corking" concept be supplied? The documentation page about corking says a lot without describing what the concept actually is, and I'm left confused.

Note: I am a high compute developer, tending to work on projects requiring high compute + high bandwidth. I typically write REST servers in C++ using either the Restino or Restbed C++ frameworks. However, it looks like the majority of REST development jobs are in Python. So I've been learning the various Python REST libs. I just discovered socketify.py this morning, and it looks very promising. Most my Python REST experience is with FastAPI.

Add decorator router

Is really good for DX just use something like:

from socketify import App

app = App()
router = app.router()

@router.get("/")
def home(res, req):
   res.end("Hello World!")

api = app.router(prefix="/api")

@api.get("/")
def home(res, req):
   res.end("Hello API!")

private = app.router(prefix="/api", token_middleware)

@private.get("/users")
def get_users(res, req, data=None):
   res.end("Hello private API!")

app.listen(
    3000,
    lambda config: print("Listening on port http://localhost:%d now\n" % config.port),
)
app.run()
  • Create app.router() inspired in Middleware router but using decorators
  • Add Documentation
  • Optimize for sync middleware with res.run_async

Error when exiting Hello World program

Describe the bug
When I run the Hello World program in the README and then exit it with Control-C (on macOS) it gives the following error:

Listening on port http://localhost:3000 now

^CFatal Python error: b_from_handle: ffi.from_handle() detected that the address passed points to garbage. If it is really the result of ffi.new_handle(), then the Python object has already been garbage collected
Python runtime state: initialized

Current thread 0x0000000102794580 (most recent call first):
  File "/opt/homebrew/Caskroom/miniconda/base/envs/socketify-env/lib/python3.10/site-packages/cffi/api.py", line 544 in from_handle
  File "/opt/homebrew/Caskroom/miniconda/base/envs/socketify-env/lib/python3.10/site-packages/socketify/uv.py", line 76 in socketify_generic_handler
  File "/opt/homebrew/Caskroom/miniconda/base/envs/socketify-env/lib/python3.10/site-packages/socketify/uv.py", line 152 in run
  File "/opt/homebrew/Caskroom/miniconda/base/envs/socketify-env/lib/python3.10/site-packages/socketify/loop.py", line 63 in run
  File "/opt/homebrew/Caskroom/miniconda/base/envs/socketify-env/lib/python3.10/site-packages/socketify/socketify.py", line 2513 in run
  File "/Users/sean/Documents/socketify-test/hello.py", line 6 in <module>

Extension modules: _cffi_backend (total: 1)
Abort trap: 6

To Reproduce
Steps to reproduce the behavior:

  1. Create Miniconda environment with condo create -n socketify-test python=3.10 and then activate it.
  2. Install socketify with pip install git+https://github.com/cirospaciari/socketify.py.git
  3. Run the Hello World program that's in the README.
  4. Hit Control-C.
  5. See error.

Expected behavior
To see no error.

Desktop (please complete the following information):

  • OS: macOS
  • Version: 12.6.1
  • Architecture: Apple Silicon

Postgres Integration with libuv and socketify Loop

Using libpq and libuv to creating something more updated than https://github.com/rootmos/libpquv

This approach should be faster than the CFFI alternative (psycopg2cffi) and on par with asyncpg.
If unable to hit the desired performance in CPython, wrapping asyncpg on CPython and psycopg2cffi (with async) on PyPy is a viable option, if in the end the performance target is met.

This library should be very simple and easy to use, new features may come with time in another feature request/issue.

Maybe take a look at https://github.com/tobymao/sqlglot for future MariaDB and SQLite3 support

  • Create Linux version
  • Create Windows build
  • Create MacOS and MacOS arm64 build
  • Benchmarking
  • Create Documentation

Add on_start and on_shutdown lifespan hooks

on start and on shutdown hooks with async and sync support is very useful when using CLI tools to do start and cleanup things.

from socketify import App

app = App()

@app.on_start
def on_start():
    pass

@app.on_shutdown
def on_shutdown():
    pass
  • Add start hook
  • Add shutdown hook
  • Add CLI support
  • Add Documentation

Error when calling `ws.close()` in WebSocket message handler

Describe the bug
Closing a WebSocket in the message handler causes a segmentation fault and the program terminates.

To Reproduce

  1. Enter the following program:
from socketify import App


def ws_message(ws, message, opcode):
    try:
        if message == 'Close me.':
            ws.close()
    except:
        print('error')


app = App()
app.ws('/ws', {
    'message': ws_message
})
app.listen(3000, lambda config: print('Listening on port %d' % config.port))
app.run()
  1. Start the program.
  2. Connect to the server with a WebSocket client.
  3. Send "Hello." to server.
  4. Notice no error.
  5. Send "Close me." to the server.
  6. See error and program terminates.
Listening on port 3000
Segmentation fault: 11

Expected behavior
For the one connection to close without error and the server keep running to handle and listen for other connections.

Desktop (please complete the following information):

  • OS: macOS
  • Version: 12.6.1
  • Architecture: Apple Silicon

Add native optimizations

These methods need native optimizations:

  • App#get_headers
  • App#get_queries
  • App#get_parameters
  • App#preserve
  • App#cork_end
  • WebSocket#cork_send
  • App#send (end + content-type + status + other headers + cork)
  • static file serving needs to be all In native (C++) without touching python at all.
  • sendfile must be all native too.

Fatal python error on benchmark code.

First of all, I'm really insterested in this great project and your progress.
However, an error has occurred while testing benchmark in my machine, so the report below is about it

Describe the bug
When I run the websockets benchmark twice in a row without server restarting, the error occured and the server was aborted.

To Reproduce
Steps to reproduce the behavior:

  1. Start socketify_server.py
  2. Run chat-client.mjs
  3. Run again chat-client.mjs
  4. See error

Expected behavior
The benchmark must be completed successfully.

Screenshots
image

Environment:
WSL Ubuntu 22.04.1 LTS on Windows 10 10.0.19044 Build 19044
Python 3.10.6 (main, Nov 2 2022, 18:53:38) [GCC 11.3.0] on linux
socketify.py 1c47511197b87c6b5f1a59dfe3bb47c9cee46aec
Node.js v18.12.1

Additional context

Full traceback
Listening on port http://localhost:4001 now

All clients connected
Starting benchmark by sending "ready" message
All clients connected
Starting benchmark by sending "ready" message
Fatal Python error: b_from_handle: ffi.from_handle() detected that the address passed points to garbage. If it is really the result of ffi.new_handle(), then the Python object has already been garbage collected
Python runtime state: initialized

Current thread 0x00007fd12d8b7000 (most recent call first):
Garbage-collecting
File "/home/mary/.local/lib/python3.10/site-packages/cffi/api.py", line 544 in from_handle
File "/home/mary/.local/lib/python3.10/site-packages/socketify/socketify.py", line 622 in get_user_data_uuid
File "/home/mary/.local/lib/python3.10/site-packages/socketify/socketify.py", line 843 in del
File "/usr/lib/python3.10/enum.py", line 385 in call
File "/home/mary/.local/lib/python3.10/site-packages/socketify/socketify.py", line 335 in uws_websocket_message_handler
File "/home/mary/.local/lib/python3.10/site-packages/socketify/uv.py", line 129 in run
File "/home/mary/.local/lib/python3.10/site-packages/socketify/loop.py", line 62 in run
File "/home/mary/.local/lib/python3.10/site-packages/socketify/socketify.py", line 1791 in run
File "/mnt/e/Github/socketify.py/bench/websockets/socketify_server.py", line 38 in

Extension modules: _cffi_backend (total: 1)
Aborted

Create pre-build libraries for windows arm64 and linux arm64

Linux on ARM is used a LOT (think in raspberry pi), a docker build or cross compile is an option.
Windows on ARM on laptops use maybe grow so adding support is a great thing.

Today we support the most used cases (#12):
Windows x64
Linux x64
MacOS ARM and x64

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.