aws4 icon indicating copy to clipboard operation
aws4 copied to clipboard

Sign WebSocket request

Open Mzem opened this issue 5 years ago • 3 comments

Hello,

Is there any options to sign a WebSocket request (for API Gateway WebSocket API) ?

Mzem avatar Sep 24 '19 15:09 Mzem

Any update on this?

codaabraham avatar Feb 06 '20 23:02 codaabraham

@mhart I am wondering if I can sign WebSocket Request through this aws4 sign library ?

aashitvyas avatar Mar 06 '20 17:03 aashitvyas

Yes there is!

aws4.sign({
  host: 'XXX.execute-api.XXX.amazonaws.com',
  path: '/XXX,
  signQuery: true,
}, {
  accessKeyId: 'XXX',
  secretAccessKey: 'XXX',
  sessionToken: 'XXX',
})

let socket = new WebSocket("wss://" + signedUrl.host + signedUrl.path)
socket.onopen = function() {
  console.log('CONNECTED')
}

aceysmith avatar Jun 22 '20 07:06 aceysmith