3 回答

TA貢獻1842條經驗 獲得超22個贊
創建信令客戶端時,您可以指定憑據或返回 的請求簽名者,請參閱: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);
添加回答
舉報