I want to completely populate the HTTP Connection Pool via JavaScript.
for (let i = 0; i < 255; i++) {
fetch(`http://testurl`, {
headers: new Headers({'Connection': 'keep-alive'}),
keepalive: true
});
}
I tried this way, but it doesn’t work. What should I do?
i tried
<script>
async function test() {
for (let i = 0; i < 255; i++) {
fetch(`https://httpbin.org/delay/0`, {
headers: new Headers({'Connection': 'keep-alive'}),
keepalive: true
});
}
}
async function exploit() {
await test();
fetch(`https://httpbin.org/delay/0`, {
headers: new Headers({'Connection': 'keep-alive'}),
keepalive: true
});
}
exploit()
</script>
But, all requests succeed sequentially. I want to fill up the HTTP Connection Pool and cause subsequent requests to fail.