# Foxglove WebSocket server
> ⚠️ Important Notice: This package is no longer maintained and has been replaced by
> [foxglove-sdk](https://pypi.org/project/foxglove-sdk/). We recommend migrating to the [Foxglove
> SDK](https://docs.foxglove.dev/docs/sdk) for future development.
This package provides a server implementation of the [Foxglove WebSocket protocol](https://github.com/foxglove/ws-protocol) with examples. The protocol enables [Foxglove](https://foxglove.dev/) to ingest arbitrary “live” streamed data.
## Example servers
This package includes example servers demonstrating how to use JSON and Protobuf data. To install additional dependencies required for the examples, run:
```
$ pip install 'foxglove-websocket[examples]'
```
Run a simple example server that publishes messages on a single `example_msg` topic:
- [JSON server](https://github.com/foxglove/ws-protocol/blob/main/python/src/foxglove_websocket/examples/json_server.py) – Uses JSON to encode message data and [JSON Schema](https://json-schema.org/) to describe the message layout.
```
python -m foxglove_websocket.examples.json_server
```
- [Protobuf server](https://github.com/foxglove/ws-protocol/blob/main/python/src/foxglove_websocket/examples/protobuf_server.py) – Uses [Protobuf](https://developers.google.com/protocol-buffers) to encode message data.
```
python -m foxglove_websocket.examples.protobuf_server
```
_Note:_ You must exit each server (<kbd>control</kbd> + <kbd>c</kbd>) before starting up another.
To see data from any server, open [Foxglove](https://app.foxglove.dev/~/view?ds=foxglove-websocket&ds.url=ws://localhost:8765/) with a Foxglove WebSocket connection to `ws://localhost:8765/`:
<img width="676" alt="Foxglove displaying data from the example server" src="https://user-images.githubusercontent.com/14237/145260376-ddda98c5-7ed0-4239-9ce4-10778ee8240b.png">
To customize each server for your specifications, copy either server into a separate file like `server.py` and make the desired adjustments to this template. Start up your server from the command line, using `python3 server.py`.
### Multi-threaded usage
The [`threaded_server` example](https://github.com/foxglove/ws-protocol/blob/main/python/src/foxglove_websocket/examples/threaded_server/__main__.py) demonstrates how to use the `FoxgloveServer` class in a thread-safe way when interacting with a threaded middleware. Run the server using:
```
python -m foxglove_websocket.examples.threaded_server
```
When connected to the server in Foxglove, use the [Data Source Info](https://docs.foxglove.dev/docs/visualization/panels/data-source-info/) panel to see channels appearing and disappearing, and a [Plot](https://docs.foxglove.dev/docs/visualization/panels/plot/) panel to visualize data on each channel.
<img width="869" alt="image" src="https://user-images.githubusercontent.com/14237/154611361-37f87c06-b85f-4117-8bfe-e1bbbc31f7f4.png">
For a more detailed explanation, read the [example's source code](https://github.com/foxglove/ws-protocol/blob/main/python/src/foxglove_websocket/examples/threaded_server/__main__.py).
## Development
When developing or maintaining the `foxglove-websocket` package, it is recommended to use [`pipenv`](https://github.com/pypa/pipenv) to manage development dependencies and `virtualenv`.
- `pipenv install --dev` – Create a `virtualenv` and install development dependencies
- `pipenv shell` – Enter the `virtualenv`
Raw data
{
"_id": null,
"home_page": "https://github.com/foxglove/ws-protocol",
"name": "foxglove-websocket",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "foxglove, websocket, robotics, ros, ros2",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/db/b5/df32ac550eb0df9000ed78d872eb19738edecfd88f47fe08588d5066f317/foxglove_websocket-0.1.4.tar.gz",
"platform": null,
"description": "# Foxglove WebSocket server\n\n> \u26a0\ufe0f Important Notice: This package is no longer maintained and has been replaced by\n> [foxglove-sdk](https://pypi.org/project/foxglove-sdk/). We recommend migrating to the [Foxglove\n> SDK](https://docs.foxglove.dev/docs/sdk) for future development.\n\nThis package provides a server implementation of the [Foxglove WebSocket protocol](https://github.com/foxglove/ws-protocol) with examples. The protocol enables [Foxglove](https://foxglove.dev/) to ingest arbitrary \u201clive\u201d streamed data.\n\n## Example servers\n\nThis package includes example servers demonstrating how to use JSON and Protobuf data. To install additional dependencies required for the examples, run:\n\n```\n$ pip install 'foxglove-websocket[examples]'\n```\n\nRun a simple example server that publishes messages on a single `example_msg` topic:\n\n- [JSON server](https://github.com/foxglove/ws-protocol/blob/main/python/src/foxglove_websocket/examples/json_server.py) \u2013 Uses JSON to encode message data and [JSON Schema](https://json-schema.org/) to describe the message layout.\n\n ```\n python -m foxglove_websocket.examples.json_server\n ```\n\n- [Protobuf server](https://github.com/foxglove/ws-protocol/blob/main/python/src/foxglove_websocket/examples/protobuf_server.py) \u2013 Uses [Protobuf](https://developers.google.com/protocol-buffers) to encode message data.\n\n ```\n python -m foxglove_websocket.examples.protobuf_server\n ```\n\n_Note:_ You must exit each server (<kbd>control</kbd> + <kbd>c</kbd>) before starting up another.\n\nTo see data from any server, open [Foxglove](https://app.foxglove.dev/~/view?ds=foxglove-websocket&ds.url=ws://localhost:8765/) with a Foxglove WebSocket connection to `ws://localhost:8765/`:\n\n<img width=\"676\" alt=\"Foxglove displaying data from the example server\" src=\"https://user-images.githubusercontent.com/14237/145260376-ddda98c5-7ed0-4239-9ce4-10778ee8240b.png\">\n\nTo customize each server for your specifications, copy either server into a separate file like `server.py` and make the desired adjustments to this template. Start up your server from the command line, using `python3 server.py`.\n\n### Multi-threaded usage\n\nThe [`threaded_server` example](https://github.com/foxglove/ws-protocol/blob/main/python/src/foxglove_websocket/examples/threaded_server/__main__.py) demonstrates how to use the `FoxgloveServer` class in a thread-safe way when interacting with a threaded middleware. Run the server using:\n\n```\npython -m foxglove_websocket.examples.threaded_server\n```\n\nWhen connected to the server in Foxglove, use the [Data Source Info](https://docs.foxglove.dev/docs/visualization/panels/data-source-info/) panel to see channels appearing and disappearing, and a [Plot](https://docs.foxglove.dev/docs/visualization/panels/plot/) panel to visualize data on each channel.\n\n<img width=\"869\" alt=\"image\" src=\"https://user-images.githubusercontent.com/14237/154611361-37f87c06-b85f-4117-8bfe-e1bbbc31f7f4.png\">\n\nFor a more detailed explanation, read the [example's source code](https://github.com/foxglove/ws-protocol/blob/main/python/src/foxglove_websocket/examples/threaded_server/__main__.py).\n\n## Development\n\nWhen developing or maintaining the `foxglove-websocket` package, it is recommended to use [`pipenv`](https://github.com/pypa/pipenv) to manage development dependencies and `virtualenv`.\n\n- `pipenv install --dev` \u2013 Create a `virtualenv` and install development dependencies\n- `pipenv shell` \u2013 Enter the `virtualenv`\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Foxglove WebSocket server (deprecated in favor of foxglove-sdk)",
"version": "0.1.4",
"project_urls": {
"Foxglove Documentation": "https://docs.foxglove.dev/",
"GitHub Issues": "https://github.com/foxglove/ws-protocol/issues",
"Homepage": "https://github.com/foxglove/ws-protocol"
},
"split_keywords": [
"foxglove",
" websocket",
" robotics",
" ros",
" ros2"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "c4733a3e6cb864ddf98800a9236ad497d32e5b50eb1682ac659f7d669d92faec",
"md5": "2e8e72e62292ee70ac8f841c349e1f74",
"sha256": "772e24e2c98bdfc704df53f7177c8ff5bab0abc4dac59a91463aca16debdd83a"
},
"downloads": -1,
"filename": "foxglove_websocket-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2e8e72e62292ee70ac8f841c349e1f74",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 14392,
"upload_time": "2025-07-14T20:26:26",
"upload_time_iso_8601": "2025-07-14T20:26:26.899789Z",
"url": "https://files.pythonhosted.org/packages/c4/73/3a3e6cb864ddf98800a9236ad497d32e5b50eb1682ac659f7d669d92faec/foxglove_websocket-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "dbb5df32ac550eb0df9000ed78d872eb19738edecfd88f47fe08588d5066f317",
"md5": "de45f7c0a573c8b902510653bd0d7df9",
"sha256": "2ec8936982e478d103dd90268a572599fc0cce45a4ab95490d5bc31f7c8a8af8"
},
"downloads": -1,
"filename": "foxglove_websocket-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "de45f7c0a573c8b902510653bd0d7df9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 16616,
"upload_time": "2025-07-14T20:26:28",
"upload_time_iso_8601": "2025-07-14T20:26:28.278430Z",
"url": "https://files.pythonhosted.org/packages/db/b5/df32ac550eb0df9000ed78d872eb19738edecfd88f47fe08588d5066f317/foxglove_websocket-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-14 20:26:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "foxglove",
"github_project": "ws-protocol",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "foxglove-websocket"
}