WebSocket Server POC

This guide outlines the steps for setting up and running the WebSocket server and client locally for development purposes.

Prerequisites

Setup

  1. Start your local Kubernetes cluster:

    For Minikube:

    minikube start

    For Kind:

    kind create cluster
  2. Install Chaos Mesh:

    Follow the Chaos Mesh installation guide to install Chaos Mesh in your local Kubernetes cluster.

  3. Start the WebSocket server:

    Use Skaffold to deploy the WebSocket server to your local Kubernetes cluster:

    skaffold dev --tail --trigger=manual

    This command starts the WebSocket server in development mode with manual trigger for rebuilds and tails the logs.

  4. Run the WebSocket client:

    In a separate terminal, run the WebSocket client:

    go run cmd/client/*.go exec

    This command executes the client, which connects to the WebSocket server and sends/receives messages.

To Generate Protocol Buffers code

Navigate to the project root directory and run:

protoc --go_out=. --go_opt=paths=source_relative proto/message.proto

Alternatively, using Docker:

docker compose run --rm app protoc --go_out=. --go_opt=paths=source_relative proto/message.proto

Additional Notes

  • You can use Chaos Mesh to perform chaos experiments on your WebSocket server to test its resilience and fault tolerance.
  • Make sure to configure your Kubernetes cluster and Skaffold settings according to your development environment.