Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

foxglove-websocket

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

foxglove-websocket

Foxglove WebSocket server

  • 0.1.2
  • PyPI
  • Socket score

Maintainers
1

Foxglove WebSocket server

This package provides a server implementation of the Foxglove WebSocket protocol with examples. The protocol enables Foxglove Studio to ingest arbitrary “live” streamed data.

Installation

$ pip install foxglove-websocket

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 – Uses JSON to encode message data and JSON Schema to describe the message layout.

    python -m foxglove_websocket.examples.json_server
    
  • Protobuf server – Uses Protobuf to encode message data.

    python -m foxglove_websocket.examples.protobuf_server
    

Note: You must exit each server (control + c) before starting up another.

To see data from any server, open Foxglove Studio with a Foxglove WebSocket connection to ws://localhost:8765/:

Foxglove Studio displaying data from the example server

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 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 Studio, use the Data Source Info panel to see channels appearing and disappearing, and a Plot panel to visualize data on each channel.

image

For a more detailed explanation, read the example's source code.

Development

When developing or maintaining the foxglove-websocket package, it is recommended to use pipenv to manage development dependencies and virtualenv.

  • pipenv install --dev – Create a virtualenv and install development dependencies
  • pipenv shell – Enter the virtualenv

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc