3 回答

TA貢獻(xiàn)1842條經(jīng)驗(yàn) 獲得超21個(gè)贊
創(chuàng)建信令客戶端時(shí),您可以指定憑據(jù)或返回 的請(qǐng)求簽名者,請(qǐng)參閱:Promise<string>
credentials {object} Must be provided unless a requestSigner is provided.
請(qǐng)注意,如果不在瀏覽器中使用憑據(jù),則還需要在服務(wù)器端運(yùn)行相關(guān)代碼,因?yàn)榇祟惒恢С终?qǐng)求簽名者。KinesisVideoSignalingChannels

TA貢獻(xiàn)1802條經(jīng)驗(yàn) 獲得超5個(gè)贊
對(duì)于 Kinesis,其中一種可能性是在 NodeJS 后端中實(shí)現(xiàn)一個(gè)用于對(duì) URL 進(jìn)行簽名的函數(shù)。
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);
添加回答
舉報(bào)