Skip to main content

quicksocket

MIT licensed Actions Status PyPI Crates.io

A simple WebSocket server built in Rust using tokio, tokio-tungstenite, and pyo3. Supports Windows, macOS, and Linux. Still unstable!

pip install quicksocket

Check out example-usage/quicksocket_with_types.py for an example of a wrapper WebsocketServer class around the quicksocket API and also provides type annotations for e.g. autocompletion in your IDE.

Not stable, a bit verbose, and a bit messy!

The server listens for WebSocket connections on port 50808, and currently this is not configurable. (see src/server/tokio_server.rs).

quicksocket's code is originally designed for use with Ultraleap's Web Visualizer project, and as such is intended for a console python visualizer server and leverages plain println!s for logging purposes.

At some point in the future it'll make sense to switch to some proper env logging system. Pardon the mess :)

Building Locally

You'll need Rust and access to some python.exe of version 3.6 or greater.

You'll also need OpenSSL. See the Ubuntu section for installation details on Ubuntu. OpenSSL is slightly trickier for Windows. You can use Chocolatey or vcpkg, or download a binary distribution of OpenSSL. You may need to set $Env:OPENSSL_DIR (PowerShell syntax) to your installation directory for your Windows build session if using Chocolatey, or a binary install, or if vcpkg isn't activated for your session. macOS should have it by default.

Once Rust is installed:

cargo build --release

This will output an .so or a .pyd depending on your OS into the target/release directory.

To build a wheel for your python/OS combo:

pip install maturin
maturin build

There's CI for Windows, macOS, and Linux for Pythons 3.6 through 3.9. Check out the Actions tab for now (proper release tags coming "soon").

Targeting builds to specific Python versions

If you're targeting a specific python version, or if you don't have python on your PATH, you can set PYTHON_SYS_EXECUTABLE to the python executable in your machine with that version.

e.g., on Windows via Git Bash:

PYTHON_SYS_EXECUTABLE=/c/my/path/to/python.exe cargo build --release

Ubuntu

Make sure you have libssl and libpython installed:

sudo apt-get install libssl-dev
sudo apt-get install libpython3-dev

If you encounter errors building pyo3, you may need to check whether it can find your python and any related python dev dependencies: https://pyo3.rs/v0.10.1/building_and_distribution.html

Todos:

Little utility HTML via github pages

Could expose this through Github Pages so it's easy for a new user to test their server usage: https://github.com/nickjbenson/quicksocket/blob/main/archive/examples/wip01_basic_websocket_client.html

Metadata

Release files for quicksocket 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for quicksocket 1.0.0
File
quicksocket-1.0.0-cp39-none-win_amd64.whl CPython 3.9 none Windows x86-64 Details
quicksocket-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
quicksocket-1.0.0-cp39-cp39-macosx_10_7_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.7+ x86-64 Details
quicksocket-1.0.0-cp38-none-win_amd64.whl CPython 3.8 none Windows x86-64 Details
quicksocket-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
quicksocket-1.0.0-cp38-cp38-macosx_10_7_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.7+ x86-64 Details
quicksocket-1.0.0-cp37-none-win_amd64.whl CPython 3.7 none Windows x86-64 Details
quicksocket-1.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64 Details
quicksocket-1.0.0-cp37-cp37m-macosx_10_7_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.7+ x86-64 Details
quicksocket-1.0.0-cp36-none-win_amd64.whl CPython 3.6 none Windows x86-64 Details
quicksocket-1.0.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.17+ x86-64 Details
quicksocket-1.0.0-cp36-cp36m-macosx_10_7_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.7+ x86-64 Details

Total release size: 9.1 MB

Release files / quicksocket-1.0.0-cp39-none-win_amd64.whl

Download URL quicksocket-1.0.0-cp39-none-win_amd64.whl
Size 417.0 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
0f5818f0d9901311c203caf90a8975e43c8578bd05c1090ddfc6cf7e3783c5e0
BLAKE2b-256 checksum
How to use checksums
17d555ccabc9f7e22b51abc19f5e41c8d02a6efcf4247e8297aacc4200afc915
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.11.2

Release files / quicksocket-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL quicksocket-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
eb9428847586e6d046d34ae53df9deb80436004ee7768482884d17f7906a6a52
BLAKE2b-256 checksum
How to use checksums
7aa16634f491ae5061777cf86f81474fc8afde961c00808c364aa36a90bd0d78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.11.2

Release files / quicksocket-1.0.0-cp39-cp39-macosx_10_7_x86_64.whl

Download URL quicksocket-1.0.0-cp39-cp39-macosx_10_7_x86_64.whl
Size 559.1 kB
Tags CPython 3.9 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
9d093e32b98a94b1b1d4db66bfb558d4aebf5bd2a501b03b6aab4d8a4dbef5ac
BLAKE2b-256 checksum
How to use checksums
8e55f06587102d43fe9a4d063ec977af746937dacd628c2d8562b2cb551ebe34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.11.2

Release files / quicksocket-1.0.0-cp38-none-win_amd64.whl

Download URL quicksocket-1.0.0-cp38-none-win_amd64.whl
Size 416.6 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
8e5b92291bd8f14e386058f94704ef8be6d0b27dbb86b8e585183b64228ad3ce
BLAKE2b-256 checksum
How to use checksums
fe3592a34337c31c3d6c67219d15b03cbfefd1cd1630ae4577b3b0a70ebca799
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.11.2

Release files / quicksocket-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL quicksocket-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
88589e445da5f76274dc65d15bb1ab9db7f5ea7fcf8715d4e5eab1d687ddd454
BLAKE2b-256 checksum
How to use checksums
80dd79b2424b6bf3519362e69d69a3ebf824ca73c6c9df5d8337abf2eae1ca55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.11.2

Release files / quicksocket-1.0.0-cp38-cp38-macosx_10_7_x86_64.whl

Download URL quicksocket-1.0.0-cp38-cp38-macosx_10_7_x86_64.whl
Size 559.2 kB
Tags CPython 3.8 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
d48f56fb4f206e68585576d02b19f0ca210dc32d79b80a62d3af8639993fff06
BLAKE2b-256 checksum
How to use checksums
8ff9f3aa7891429a6ac2b65138caa9753f443a63299c56d67d87e5006e758da4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.11.2

Release files / quicksocket-1.0.0-cp37-none-win_amd64.whl

Download URL quicksocket-1.0.0-cp37-none-win_amd64.whl
Size 416.7 kB
Tags CPython 3.7 Windows x86-64
SHA-256 checksum
How to use checksums
10f02109f733ff530f5c258aecf595676c50aadc96112d82dcf4e3766e4d65a2
BLAKE2b-256 checksum
How to use checksums
cd7d31f8e364c30e1da5e91d633d524196b3894a1b83b1951931d6c8eca7048a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.11.2

Release files / quicksocket-1.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL quicksocket-1.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
fb720328fbf96492840c695596fc53f2179ee71ddf44704543504135da855301
BLAKE2b-256 checksum
How to use checksums
fa31e123d5f4f3a156f5c379043f0925e492a76da33839fb682901483a27dd05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.11.2

Release files / quicksocket-1.0.0-cp37-cp37m-macosx_10_7_x86_64.whl

Download URL quicksocket-1.0.0-cp37-cp37m-macosx_10_7_x86_64.whl
Size 559.7 kB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
5ab825cdf5c301020ae3d8dc6fd2f4dd20cbe9b7ccfe31184ad6455be6469210
BLAKE2b-256 checksum
How to use checksums
f5b5411ccaba50a3403ab833d6ef9b73621875a31136bbab6a5594abfe3135b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.11.2

Release files / quicksocket-1.0.0-cp36-none-win_amd64.whl

Download URL quicksocket-1.0.0-cp36-none-win_amd64.whl
Size 416.3 kB
Tags CPython 3.6 Windows x86-64
SHA-256 checksum
How to use checksums
4e44f7333ace97d5aad21931f078aa0c81f4f9742539a0214976dde768f97a9f
BLAKE2b-256 checksum
How to use checksums
e287561fcb0f0849a1dea62e529c231fccf22a9c342d728904bb59ae8b7be5c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.11.2

Release files / quicksocket-1.0.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL quicksocket-1.0.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
a05a9695aa1e6e35b5fac49038d412b9a9dd0029c3404a918fd7f18ec34872ce
BLAKE2b-256 checksum
How to use checksums
99ddfdeae079b1f404dbfeaa99aed540f370e24b2384fb9eb05c3bc838971e03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.11.2

Release files / quicksocket-1.0.0-cp36-cp36m-macosx_10_7_x86_64.whl

Download URL quicksocket-1.0.0-cp36-cp36m-macosx_10_7_x86_64.whl
Size 558.2 kB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
95d3b4974987aa76b9d3f964ae26f09eaa91b3ccf82865cbd5e7260abc659a9e
BLAKE2b-256 checksum
How to use checksums
9798e3fe84cc11c427100eac58d5b4a7caed59c9b36be60d256a9cad83d698d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.11.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

12 release files

0.1.3

12 release files

0.1.2

12 release files

0.1.1

12 release files

0.1.0

8 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page