Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/CourtneyLO/websocket-generator/src

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/CourtneyLO/websocket-generator/src

  • v0.0.0-20220107151411-8a79f9b5e263
  • Source
  • Go
  • Socket score

Version published
Created
Source

WebSocket Generator - WIP

This script will generate a fully functional WebSocket using AWS Gateway Api and DynamoDB.

The WebSocket routes will be as follows:

  • $connect: Makes the WebSocket connection and saves the connectionID, timestamp and deviceTypeto a dynamoDB table. DeviceType helps to distinguish between different device connectivity
  • $disconnect: Disconnects the WebSocket and removes the connectionID from the dynamoDB table.
  • $default: This will contain the __PING__ __PONG__ functionality which ensures the connection can kept alive throughout it's use.

It will be built using Terraform and Serverless with choice of one of the following 6 languages:

  • Node
  • Typescript
  • Python
  • Golang
  • Java
  • Ruby

All Terraform and Serveless code will be added to you project in the directory of your choice. Once the coded is added you can alter or modified the code as you please. You can choose to continue using the build in scripts (see below)or use the Terraform and Serverless commands independently, it is up you. This is a quick first step to creating your own websocket.

Prerequists

  • You will need to have your aws account ID
  • For a better user interface use a full screen terminal tab

Config Questions

QuestionDescriptionDefaultExamples
1Select your preferred languageThe language you wish for your WebSocket lambdas to be writtenNodeNode, Typescript, Python, Golang, Java, Ruby
2Environment NameThe environment you wish to deploy your codeDevelopmentDevelopment, Staging, Production
3Infrastructure Code Location PathThe path should be only the path from the current directory. The current Directory path will be joined with the given path. Make sure to be in the directory (project) you wish to add the WebSocket infrastructure code too.infrastructureinfrastructure
4WebSocket Code Location PathThe path should be only the path from the current directory. The current Directory path will be joined with the given path. Make sure to be in the directory (project) you wish to add the WebSocket serverless code too.websocketwebsocket
5Terraform Resource NameThe prefix you wish to add to all your resource names. Resource name format will look as <terraform-resource-name>-<environment>-<specifc-resource-name>your projects namehelloworld-development-websocket-manager
6AWS RegionThe AWS region where you want your infrastructure to be locatedeu-west-2us-east-1
7AWS Account IDThe AWS account ID that you wish to use for your infrastructureThis is required, there is no default123456789000
8Authorization Key NameThe name of the authorizer query parameter on your WebSocket URLAuthorization?Authorization=1234

FAQs

Package last updated on 07 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc