Skip to content

JavaHutt/ws-proxy

Repository files navigation

Repository Top Language GitHub go.mod Go version Github Repository Size License GitHub last commit Coding all night)

Proxy server component

Task description

Task description is in DESCRIPTION.md

Issues found in task description and fixed

  • signal.Notify wasn't cathing SIGTERM signal
  • proxy.OrderRequest had a uint8(rand.Uint32()) randomizer, which will return 1 or 2 very rarely. Not good for testing purposes

Solution notes

  • 🏆 standard Go library (except for Gorilla Websocket package)
  • ↪️ clean architecture (server->handler->service)
  • 📖 standard Go project layout
  • 🔨 Docker-compose, Dockerfiles & Makefile included
  • 🚽 tests with mocks included

HOWTO

  • start server with
make server
  • then start proxy component with some restrictions
make proxy N=5 S=7000

where N is a limit of opened orders per client per instrument at the moment of time and S is the sum limit of volumes of opened orders per client per instrument at the moment of time

  • finally, start the client:
make client
  • test with
make test
  • start server with proxy in containers:
make up
  • stop container:
make down

A picture is worth a thousand words

About

Websocket proxy component

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published