New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

aws-post-to-connection

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-post-to-connection

post to a connected websocket client via api gateway


Version published
Maintainers
1
Created

aws-post-to-connection

js-standard-style build status downloads Greenkeeper badge

post to a connected websocket client.

usage

const PostToConnection = require('aws-post-to-connection')

// post to same gateway
const postToSameGateway = PostToConnection(event)
await postToSameGateway({ message: 'hello' }, 'connectionId')

// post to another gateway
const postToAnotherGateway = PostToConnection({
  stage: 'stage',
  domainName: '<apiId>.execute-api.<region>.amazonaws.com'
})
await postToConnection({ message: 'hello' }, 'connectionId')

// post to local websocket server
const postToLocalhost = PostToConnection({
  stage: 'stage',
  domainName: 'localhost',
  secure: false
})
await postToConnection({ message: 'hello' }, 'connectionId')

Works locally and in a lambda function.

license

Apache License, Version 2.0

FAQs

Package last updated on 13 Jan 2019

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