Skip to content

A simple web-socket server implemented in Go lang for experimentation purposes.

Notifications You must be signed in to change notification settings

IAmRiteshKoushik/go.sock-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WebSocket Orderbook (Simulated)

This project is an introduction to web-sockets using Go lang without using any framework. It uses the standard packages and simulates an orderbook.

Steps to run:

  1. Repo setup
git clone https://github.com/IAmRiteshKoushik/go.sock-server
cd go.sock-server
go mod tidy
  1. Open two browsers side by side -> inspect element -> go to console
  2. Type the following in both console:
let socket = new WebSocket("ws://localhost:3000/orderbook")
socket.onmessage = (event) => { console.log("Order received: ", event.data); }

You should see a stream of messages being sent to both instances of your browser console at a one second interval.

About

A simple web-socket server implemented in Go lang for experimentation purposes.

Topics

Resources

Stars

Watchers

Forks

Languages