Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iamriteshkoushik/go.sock-server
A simple web-socket server implemented in Go lang for experimentation purposes.
https://github.com/iamriteshkoushik/go.sock-server
golang orderbook websocket-server
Last synced: 1 day ago
JSON representation
A simple web-socket server implemented in Go lang for experimentation purposes.
- Host: GitHub
- URL: https://github.com/iamriteshkoushik/go.sock-server
- Owner: IAmRiteshKoushik
- Created: 2024-02-16T15:01:12.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-08-15T10:41:58.000Z (3 months ago)
- Last Synced: 2024-08-15T12:20:38.090Z (3 months ago)
- Topics: golang, orderbook, websocket-server
- Language: Go
- Homepage:
- Size: 67.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
```go
git clone https://github.com/IAmRiteshKoushik/go.sock-server
cd go.sock-server
go mod tidy
```2. Open two browsers side by side -> inspect element -> go to `console`
3. Type the following in both console:
```js
let socket = new WebSocket("ws://localhost:3000/orderbook")
```
```js
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.