Skip to content

Commit ed5c680

Browse files
authored
1 parent 9f6d1b3 commit ed5c680

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/data/markdown/docs/01 guides/02 Using k6/05 Options.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,8 @@ An object with overrides to DNS resolution, similar to what you can do with `/et
339339
Linux/Unix or `C:\\Windows\\System32\\drivers\\etc\\hosts` on Windows. For instance, you could set
340340
up an override which routes all requests for `test.k6.io` to `1.2.3.4`.
341341

342+
From v0.28.0 it is also supported to redirect only from certain ports and/or to certain ports.
343+
342344
> #### ⚠️ Keep in mind!
343345
>
344346
> 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`.
353355
export let options = {
354356
hosts: {
355357
'test.k6.io': '1.2.3.4',
358+
'test.k6.io:443': '1.2.3.4:8443',
356359
},
357360
};
358361
```
359362

360363
</div>
361364

365+
With the above code any request made to `test.k6.io` will be redirected to `1.2.3.4` without changing
366+
it port unless it's port is `443` which will be redirected to port `8443`.
367+
362368
### HTTP Debug
363369

364370
Log all HTTP requests and responses. Excludes body by default, to include body use

0 commit comments

Comments
 (0)