How to set the value of "hostNameAliases"

Hi. I’ve been using Gatling for 4-5 months and I’m a bit stuck with what seems to be a simple problem. I’m new to scala.

hostNameAliases is not applied
I’m debugging the script through a fiddler.
In the fiddler, I brought out a new column with the IP.
But in this column, I do not observe that the value from the “hostNameAliases” parameter is substituted in the IP

  val httpProtocolWeb: HttpProtocolBuilder = http
    .hostNameAliases(Map("test.com" -> List("333.333.33.33")))
    .baseUrl("https://test.com")
    .acceptHeader("*/*")
    .acceptEncodingHeader("gzip, deflate, br")
    .acceptLanguageHeader("ru,en;q=0.9")
    .header("referer", "https://test.com")
    .check(status.in(200,204))

Hello @GeorgeDev,

Did you try with valid IPs?

“333.333.33.33” is not a valid IP
Do you see “test.com” (or the real value) in fiddler from gatling process?

Cheers!

@sbrevet
1.Yes, I use a valid IP. I specified 333… as an example
2.Yes, I see the real IP test.com in fiddler
But since I set the “hostNameAliases” parameter, I should see its value, but unfortunately I don’t see it

That’s a misunderstanding of how proxies work.

hostNameAliases only works for the DNS resolutions that Gatling performs.

If you’re setting a proxy (such as fiddler), Gatling (or any other user-agent) will only resolve the address of the proxy and connect to it. The one resolving the address of proxified hostname so that it can connect to it and forward the requests is the proxy.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.