zianwar / go-websocket-broadcast

Broadcast server implementation using websockets in golang.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-ws-broadcast

A simple implementation of a concurrent broadcast server that dispatches a message to the connected clients via the websocket protocol.

Diagram

Components:

consists of:

  • A counter that gets incremented frequently and its value will be broadcasted to all clients.
  • A hub component that registers and de-registers clients and broadcasts the counter value to the clients.

This is a basic React app that acts as a client to the broadcast server, which:

  • Establishes a websocket connection to the server and displays a green background upon a successfull connection.
  • Starts reading the counter value and displaying it.
  • Changes the background to red when the websocket connection closes or errors out.

Demo

Demo

About

Broadcast server implementation using websockets in golang.


Languages

Language:Go 46.2%Language:JavaScript 28.3%Language:HTML 20.2%Language:CSS 5.3%