From c77bbd2daa2c675064c4b9f9d177744c19dc13e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Sat, 31 May 2025 11:34:54 -0300 Subject: [PATCH 1/2] feat: generate random content for HTTP resource --- src/programs/http_client.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/programs/http_client.ts b/src/programs/http_client.ts index 3f88749a..d99405dc 100644 --- a/src/programs/http_client.ts +++ b/src/programs/http_client.ts @@ -23,8 +23,12 @@ const RESOURCE_MAP_SIZES = new Map([ function generateResource(size: number): Uint8Array { const resource = new Uint8Array(size); + const characters = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; for (let i = 0; i < size; i++) { - resource[i] = Math.floor(Math.random() * 256); + resource[i] = characters.charCodeAt( + Math.floor(Math.random() * characters.length), + ); } return resource; } From e8997809cb96582b97ee01eb89e704df1a3002f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Sat, 31 May 2025 11:37:03 -0300 Subject: [PATCH 2/2] fix: use IP instead of object --- src/programs/http_client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/programs/http_client.ts b/src/programs/http_client.ts index d99405dc..f72668ef 100644 --- a/src/programs/http_client.ts +++ b/src/programs/http_client.ts @@ -83,7 +83,7 @@ export class HttpClient extends ProgramBase { // Encode HTTP request // NOTE: For now, as hosts have just one interface, destination ip is hardcoded const httpRequest = getContentRequest( - this.runner.interfaces[0].toString(), + this.runner.interfaces[0].ip.toString(), this.resource, );