Skip to content

Proof of concept project to demo working of Websockets using AngularJS (UI) and GO (back end)

Notifications You must be signed in to change notification settings

shreyassrinath/websocketexample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebSockets using Angularjs and Go

Proof of concept project to showcase working of Websockets using AngularJS (UI) and GO (back end).

Description

The goal of this project is to test uses of Websockets in web applications. WebSockets enables to open an interactive session between user's browser and server. This mainly helps is avoiding polling the server for events.

Some use cases of WebSockets are:

  • Social feeds
  • Multi player games
  • Document collaboration
  • Financial Tickers
  • Click stream data analysis
  • Sports updates
  • Chat
  • Etc..

This project aims to use WebSockets for the financial tickers use case. When user browses to the app, a websocket connection is opened to the backend server. The server listens to the "ticker" request from the UI- the connection is kept open. When a ticker request comes in, a go routine is spawned and starts quering Yahoo for the stock quotes every second. The go routine ends when another request comes in and another go routine is started.

Installation requirements

  • Install VirtualBox and Vagrant
  • Clone this repo
  • The Vagrant file install docker and docker-compose for easily spinning up apps.

Commands

  • Start
    • vagrant up
  • SSH into VM
    • vagrant ssh
  • cd into project folder
    • cd websocketExample
  • Build docker container
    • docker-compose build
  • Start docker container
    • docker-compose up
  • Navigate to http://192.168.33.46

Alt

References

About

Proof of concept project to demo working of Websockets using AngularJS (UI) and GO (back end)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published