From 52eab268e843061c93a196bf9b11709ea0169dec Mon Sep 17 00:00:00 2001 From: Mihail Stoykov Date: Wed, 23 Sep 2020 13:03:23 +0300 Subject: [PATCH] Document loadimpact/k6#1489 --- src/data/markdown/docs/01 guides/02 Using k6/05 Options.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/data/markdown/docs/01 guides/02 Using k6/05 Options.md b/src/data/markdown/docs/01 guides/02 Using k6/05 Options.md index b69654f950..c57d1b9b36 100644 --- a/src/data/markdown/docs/01 guides/02 Using k6/05 Options.md +++ b/src/data/markdown/docs/01 guides/02 Using k6/05 Options.md @@ -339,6 +339,8 @@ An object with overrides to DNS resolution, similar to what you can do with `/et Linux/Unix or `C:\\Windows\\System32\\drivers\\etc\\hosts` on Windows. For instance, you could set up an override which routes all requests for `test.k6.io` to `1.2.3.4`. +From v0.28.0 it is also supported to redirect only from certain ports and/or to certain ports. + > #### ⚠️ Keep in mind! > > This does not modify the actual HTTP `Host` header, but rather where it will be routed. @@ -353,12 +355,16 @@ up an override which routes all requests for `test.k6.io` to `1.2.3.4`. export let options = { hosts: { 'test.k6.io': '1.2.3.4', + 'test.k6.io:443': '1.2.3.4:8443', }, }; ``` +With the above code any request made to `test.k6.io` will be redirected to `1.2.3.4` without changing +it port unless it's port is `443` which will be redirected to port `8443`. + ### HTTP Debug Log all HTTP requests and responses. Excludes body by default, to include body use