Skip to content

Feat: add barebones websocket client/server

What does this MR do and why?

This change refactors the server architecture to support multiple server types. The main server.py file has been simplified by moving the gRPC server implementation to a dedicated module (grpc_server.py) and adding a new WebSocket server implementation. The code now supports running both server types simultaneously, with the WebSocket server being optional and controlled by environment variables. The main function has been updated to start both servers when configured, and proper shutdown handling has been added. This modular approach makes the codebase more maintainable and allows for easier addition of different server types in the future.

Related issues

#361 (closed)

Screenshots or screen recordings

Screenshot_2025-04-28_at_23.48.01

Refusal of second client connection:

Screenshot_2025-04-24_at_11.37.59

How to set up and validate locally

  • check out this branch
  • set env vars: WEBSOCKET_SERVER=true and WEBSOCKET_PORT=8080
  • run the duo workflow service
  • run the example client poetry run python tests/example_websocket_client.py --port 8080
Edited by Jeff Park

Merge request reports

Loading