Python/JavaScript library for communicating over WebSocket
Project description
Wslink allows easy, bi-directional communication between a python server and a javascript client over a websocket. The client can make RPC calls to the server, and the server can publish messages to topics that the client can subscribe to. The server can include binary attachments in these messages, which are communicated as a binary websocket message, avoiding the overhead of encoding and decoding.
RPC and publish/subscribe
The initial users of wslink driving its development are VTK and ParaView. ParaViewWeb and vtkWeb require:
RPC - a remote procedure call that can be fired by the client and return sometime later with a response from the server, possibly an error.
Publish/subscribe - client can subscribe to a topic provided by the server, possibly with a filter on the parts of interest. When the topic has updated results, the server publishes them to the client, without further action on the client’s part.
Get the whole story
This package is just the server side of wslink. See the github repo for the full story - and to contribute or report issues!
Configure from environment variables
Those only apply for the Python server and launcher.
WSLINK_LAUNCHER_GET - If set to 1 this will enable the GET endpoint for session information
WSLINK_LAUNCHER_DELETE - If set to 1 this will enable the DELETE endpoint for killing a running session
WSLINK_MAX_MSG_SIZE - Number of bytes for a message size (default: 4194304)
WSLINK_HEART_BEAT - Number of seconds between heartbeats (default: 30)
WSLINK_HTTP_HEADERS - Path to json file containing HTTP headers to be added
License
Free to use in open-source and commercial projects, under the BSD-3-Clause license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file wslink-2.2.1.tar.gz
.
File metadata
- Download URL: wslink-2.2.1.tar.gz
- Upload date:
- Size: 31.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf79c7e3abe47f19af641c81f051ef97a2a2cbb96359cf243517afde16764b82 |
|
MD5 | 71d9086ad9d0a5c477e7a6f8106c42aa |
|
BLAKE2b-256 | 3f41cdce3558d698dd7617c347fbb0497f0f26fdcb9e02afa7125117e11699ec |
File details
Details for the file wslink-2.2.1-py3-none-any.whl
.
File metadata
- Download URL: wslink-2.2.1-py3-none-any.whl
- Upload date:
- Size: 36.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfa1ce14b576f4a4ac4478e74c92a1445000f4fbf33923c98ffd1dc922c993e2 |
|
MD5 | fbc244f95005204bd365521641900f0d |
|
BLAKE2b-256 | a2d81ad7a999e79fc002f814d15dbef4914c6cf9d28231bfa74002b93e48b9af |