Member-only story
Getting started with WebSockets on API Gateway with .NET and the Serverless Framework

We have some projects coming up at work which have the requirement of real-time data being pushed between devices. I’ve been eyeing off WebSockets on API Gateway for some time and now seemed like a great opportunity to get my hands dirty and give it a go. Whenever I make a recommendation for a solution to our teams, I like to know how the service works and it’s intricate details so I provide pointers and in-depth details to our developers who will ultimately be implementing my recommended solution.
The other part of experimenting with WebSockets was writing the code for Lambda in .NET as most tutorials I found were written in nodeJS. Thanks to Norm Johanson @ AWS for his port to .NET as a base for what I used to get started.
How Does WebSockets Work?
For those not familiar with WebSockets, WebSockets allow a device to create a connection between itself and a remote service which can be used to send and receive data real-time. The connection remains open allowing data to traverse until such time either end closes the connection.