gbm-challenge-wsserver

command module
v0.0.0-...-942310b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 12 Imported by: 0

README

GBM Challenge Websocket server

A microservice that consumes messages from rabbitmq and publishes them to clients via websockets.

The counterpart for this service that must be run in conjunction with this one to get a fully functioning setup can be found here.

Features

  • Two way communication between client and server through websockets
  • Consume location information per ride
  • Connect multiple clients to same ride location stream

Requirements

  • go1.11.2+

Usage

Go get the repository
go get bitbucket.org/jrlangford/gbm-challenge-wsserver
Build the binary
cd $GOPATH/bitbucket.org/jrlangford/gbm-challenge-wsserver
go get
go build
Build example clients

Follow the instructions on the example client README.md

Run the system

Run the server

./gbm-challenge-wsserver

This will launch the server listening, by default, on 'localhost:8090'

Run multiple example clients

./examples/client --ride_tag <ride_tag>

API

Ride
GET websocket

URI: /api/v0/connect/<ride_tag> Opens a websocket connection between the client and the server and starts consuming data from the rabbitmq exchange marked with ride_tag.

Troubleshooting

In case any errors appear in the websocket server log, restart the server and reconnect clients

Potential improvements

  • Extensive testing
  • User authentication via oauth
  • Definition of Lightweight communications protocol oer websockets
  • User authentication via oauth
  • Extensive input validation
  • HTTP header setting and validation
  • Dependency management
  • Avoid go routine leakage

Documentation

Overview

Package main declares and executes the base Server structure and methods.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL