Crates.io | scalesocket |
lib.rs | scalesocket |
version | |
source | src |
created_at | 2022-11-05 14:39:38.231469 |
updated_at | 2024-11-23 10:29:45.910506 |
description | A collaborative websocket server and autoscaler |
homepage | https://scalesocket.org/ |
repository | https://github.com/scalesocket/scalesocket/ |
max_upload_size | |
id | 705839 |
Cargo.toml error: | TOML parse error at line 26, column 1 | 26 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
ScaleSocket is a collaborative websocket server and autoscaler. It's a simple way to build multiplayer backends.
ScaleSocket is a command line tool that lets you to wrap a script or binary, and serve it collaboratively over websockets. Clients then connect to rooms (a.k.a. channels) which have a unique URL (wss://example.com/exampleroom
). Connecting to a room spawns a new process of the wrapped binary. Subsequent connections to the same room share the process.
For full details and installation instructions, see the documentation.
Share a backend process between websocket clients
Proxy websocket traffic to normal TCP socket or stdio
Route server messages to specific clients
Serve static files
Expose CGI environment variables to backend process
OpenMetrics compatible
Built-in lobby server for listing rooms
Create the file example.sh
with the follow content:
#!/bin/bash
echo '{"message": "hello world"}'
sleep 1
echo '{"message": "goodbye"}'
sleep 1
Make it executable:
$ chmod u+x example.sh
Wrap it by starting the ScaleSocket server:
$ scalesocket ./example.sh
Then connect to the websocket endpoint, for example using curl:
$ curl --include \
--no-buffer \
--http1.1 \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
http://localhost:9000/exampleroom
�{"message": "hello world"}�{"message": "goodbye"}%
For more advanced usage and features, see usage.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.