A Use Case for Websockets in Go

Johnny Estilles

GoManila Mondays

September 2019

Johnny Estilles

Regional Director of Engineering
Freelancer.com

johnny@freelancer.com

@JohnnyEstilles

GoManila Mondays

September 2019

GoManila

GoLang Developers Meetup Group

GoManila Mondays

September 2019

GoManila Mondays

September 2019

GoManila Mondays

September 2019

What are websockets?

  • Real-time full duplex communication over TCP
  • Standardized by IETF (RFC 6455)
  • Uses TCP ports 80 and 443
  • Uses URL schemes ws:// and wss://
  • Very small overhead for text messages (frames)
  • Common use cases:
    • games
    • social feeds
    • chat
    • collaborative apps
    • financial tickers

GoManila Mondays

September 2019

What are websockets?

GoManila Mondays

September 2019

The WebSocket API (WebSockets)

GoManila Mondays

September 2019

Gorilla WebSocket

GoManila Mondays

September 2019

Use Case: Animating CG Graphics on OBS

Server Side Stack

  • Go 1.13
  • Gorilla Websocket
  • Docker

Client Side Stack

  • StencilJS
  • RxJS

GoManila Mondays

September 2019

Use Case: Animating CG Graphics on OBS

Let's review my code!

GoManila Mondays

September 2019

Use Case: Animating CG Graphics on OBS

Demo time!

GoManila Mondays

September 2019

Thank you!

GoManila Mondays

September 2019

References

Made with Slides.com