websocket/

directory
v0.0.0-...-7945a20 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2019 License: Apache-2.0

README

Websocket

AWS websocket reference implementation based of the following architecture:

Websocket Architecture https://aws.amazon.com/blogs/compute/announcing-websocket-apis-in-amazon-api-gateway/

It is a golang rendition of the Node.js example alongside terraform configurations.

_ All components have been implemented here except the web socket api component it is still being added to the aws provider functionalies in terraform. _

TODO

  1. Create API Gateway REST API v2
  2. Broadcast message wend send-message function is invoked.

Usage

Usage assumes you already have terraform (v0.12) and awscli (v2.42) setup and you are in the websocket folder.

Execute the following:

make init
make package
make run

To test on-connect, provide the following as params to the function in the AWS UI and inspect the Dynamo DB to confirm a record is inserted:

{
  "connection_id": "fd991532-23b2-11ea-978f-2e728ce88125"
}

To test on-disconnect, provide the following as params to the function in the AWS UI and inspect the Dynamo DB to confirm the initially created record is removed:

{
  "connection_id": "fd991532-23b2-11ea-978f-2e728ce88125"
}

To cleanup everything, run:

make destroy

Directories

Path Synopsis
on-connect
src
on-disconnect
src
send-message
src

Jump to

Keyboard shortcuts

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