3 回答
TA贡献1842条经验 获得超21个赞
创建信令客户端时,您可以指定凭据或返回 的请求签名者,请参阅:Promise<string>
credentials {object} Must be provided unless a requestSigner is provided.
请注意,如果不在浏览器中使用凭据,则还需要在服务器端运行相关代码,因为此类不支持请求签名者。KinesisVideoSignalingChannels
TA贡献1802条经验 获得超5个赞
对于 Kinesis,其中一种可能性是在 NodeJS 后端中实现一个用于对 URL 进行签名的函数。
const endpointsByProtocol = getSignalingChannelEndpointResponse.ResourceEndpointList.reduce((endpoints, endpoint) => {
endpoints[endpoint.Protocol] = endpoint.ResourceEndpoint;
return endpoints;
}, {});
console.log('[VIEWER] Endpoints: ', endpointsByProtocol);
const region = "us-west-2";
const credentials = {
accessKeyId: "XAXAXAXAXAX",
secretAccessKey: "SECRETSECRET"
};
const queryParams = {
'X-Amz-ChannelARN': channelARN,
'X-Amz-ClientId': formValues.clientId
}
const signer = new SigV4RequestSigner(region, credentials);
const url = await signer.getSignedURL(endpointsByProtocol.WSS, queryParams);
console.log(url);
添加回答
举报