Harden the app
This commit is contained in:
1 parent
d92c4b50cf
commit
e3a2b348d6
5 files changed
+38
-12
No files matched your search
@@ -323,6 +323,17 @@ test('limits connections per IP to 16', async () => {
|
||||
expect(await open()).toBeTruthy();
|
||||
});
|
||||
|
||||
test('counts IPv6 by /64, however it is written', async () => {
|
||||
for (let i = 1; i <= 16; i++) {
|
||||
ip = [`2001:db8:${tests}::${i.toString(16)}`, `2001:0DB8:${tests}:0:${i}::`][i % 2];
|
||||
expect(await open()).toBeTruthy();
|
||||
}
|
||||
ip = `2001:db8:${tests}:0:ffff:ffff:ffff:ffff`;
|
||||
expect(await open()).toBeUndefined();
|
||||
ip = `2001:db8:${tests}:1::1`;
|
||||
expect(await open()).toBeTruthy();
|
||||
});
|
||||
|
||||
test('survives clients resetting refused connections', async () => {
|
||||
for (let i = 0; i < 100; i++) {
|
||||
const socket = connectTcp(new URL(url).port, '127.0.0.1');
|
||||
|
||||
Reference in new issue
Block a user