如何解决在Chrome中超过了500个对等端限制无法创建那么多PeerConnections
我正在DDoS应用程序上进行一些测试,并且需要创建500个以上的对等连接。我对相关问题进行了深入研究,但是无论我做什么,也无论我明确指出哪种状态,我都不能超过500个同级限制。
简而言之,我正在尝试清除401上的同级物:
function iceCandidateError(e,pc) {
console.log(e.errorCode);
if (e.errorCode == 401) {
pc.close();
pc = null;
}
}
async function makeCall(config,requestCount) {
const offerOptions = { offerToReceiveAudio: 1 };
console.log(
`Creating new PeerConnection with config=${JSON.stringify(config)}`
);
for (let i = 0; i < requestCount; i++) {
let pc = new RTCPeerConnection(config);
pc.onicecandidateerror = (event) => iceCandidateError(event,pc);
const desc = await pc.createOffer(offerOptions);
await pc.setLocalDescription(desc);
}
}
我需要在这里做些时髦的事情吗?
看着chrome://webrtc-internals/
,我看到成对的对等连接打开了,但没有一个被删除-它们只是一直存在。我认为pc.close()
确实可以将其关闭。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。