0.1.21 • Published 3 years ago

aws-post-to-connection v0.1.21

Weekly downloads
7
License
Apache-2.0
Repository
github
Last release
3 years ago

aws-post-to-connection

js-standard-style build status downloads

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',
  port: 5000,
  secure: false
})
await postToConnection({ message: 'hello' }, 'connectionId')

Works locally and in a lambda function.

license

Apache License, Version 2.0

0.1.21

3 years ago

0.1.20

4 years ago

0.1.19

4 years ago

0.1.18

4 years ago

0.1.15

4 years ago

0.1.16

4 years ago

0.1.17

4 years ago

0.1.12

4 years ago

0.1.11

4 years ago

0.1.7

4 years ago

0.1.4

4 years ago

0.1.6

4 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.5

5 years ago