# Proxy with Gatling doesn't consider localhost traffic

**URL:** <https://community.gatling.io/t/proxy-with-gatling-doesnt-consider-localhost-traffic/7358>\
**Category:** Gatling (Open-Source)\
**Created:** [November 30, 2022, 2:33pm UTC](https://community.gatling.io/t/proxy-with-gatling-doesnt-consider-localhost-traffic/7358 "2022-11-30T14:33:03Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArthurG](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@ArthurG](https://community.gatling.io/u/ArthurG)\
**Post date:** [November 30, 2022, 2:33pm UTC](https://community.gatling.io/t/proxy-with-gatling-doesnt-consider-localhost-traffic/7358/1 "2022-11-30T14:33:03Z")

</div>

Hello,

I have a small problem with the use of proxy.  
I want to test my project that I am developing, **locally**. Unfortunately, when I record the logs with the **proxy** as Gatling allows me to do, the logs of the localhost are not displayed… (clearly, it does not detect the localhost). I have unchecked the box ‘Don’t use the proxy server for local (intranet) addresses’ in my proxy settings, but it’s the same result.

If you know how to help me, I’m interested !

I hope to hear from you,

AG

---

<div class="post-metadata">

**Author:** ![GeMi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/gemi/32/939_2.png) [@GeMi](https://community.gatling.io/u/GeMi)\
**Post date:** [November 30, 2022, 7:26pm UTC](https://community.gatling.io/t/proxy-with-gatling-doesnt-consider-localhost-traffic/7358/2 "2022-11-30T19:26:30Z")

</div>

Do you get any error?  
You using Gatling Recorder? What version of Gatling?

Maybe you have similar issue:

> [@Recorder self-signed certificate crashes on Java 15+](https://community.gatling.io/t/recorder-self-signed-certificate-crashes-on-java-15/7326):
>
> Hi, I recently upgraded to the 3.8.4 release of Gatling and I have openjdk@17/17.0.5 installed. When I try to record traffic using gatling3.8.4 recorder I get an exception which I don’t get when I use the recorder in gatling3.5.1 The exception is: \> [ERROR] [11/18/2022 12:18:43.587] [recorder-akka.actor.internal-dispatcher-3] [akka://recorder/user/$a] No provider succeeded to generate a self-signed certificate. See debug log for the root cause. \> java.security.cert.CertificateException: No pro…

If you want you can use in this case some workaround:  
In Gatling Recorder you can convert HAR file to Simulation so you can make all steps on page with selected “Preserve logs” and “Disable cache” and after them “Save all as HAR with content”:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/7/71a17a7551d5538f17e4919e51ce738cfb7c5e39.png)

Then in Gatling Recorder:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/8/827ab31db7ffc13cb90f34ae5ba3509dcaa25bd6.png)

And wua la:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/d/d7e29e0644c8a3a837fb8b174ed607b261f5f4ee.png)

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [December 1, 2022, 12:47am UTC](https://community.gatling.io/t/proxy-with-gatling-doesnt-consider-localhost-traffic/7358/3 "2022-12-01T00:47:27Z")

</div>

My2cents: you’ve left localhost in the « ignore proxy for hosts » box in your browser configuration.

---

<div class="post-metadata">

**Author:** ![ArthurG](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@ArthurG](https://community.gatling.io/u/ArthurG)\
**Post date:** [December 1, 2022, 8:02am UTC](https://community.gatling.io/t/proxy-with-gatling-doesnt-consider-localhost-traffic/7358/4 "2022-12-01T08:02:50Z")

</div>

Yes, I know this solution but I think it’s easier to use the proxy 🙂

Thank you for you answer !

AG

---

<div class="post-metadata">

**Author:** ![ArthurG](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@ArthurG](https://community.gatling.io/u/ArthurG)\
**Post date:** [December 1, 2022, 8:54am UTC](https://community.gatling.io/t/proxy-with-gatling-doesnt-consider-localhost-traffic/7358/5 "2022-12-01T08:54:48Z")

</div>

Yes I did but it’s the same result !

---

<div class="post-metadata">

**Author:** ![sbrevet](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/sbrevet/32/830_2.png) [@sbrevet](https://community.gatling.io/u/sbrevet)\
**Post date:** [December 1, 2022, 11:27am UTC](https://community.gatling.io/t/proxy-with-gatling-doesnt-consider-localhost-traffic/7358/6 "2022-12-01T11:27:14Z")

</div>

Did you try with `127.0.0.1`? Or did you try to use your external IP?

Usually, browsers bypass `localhost` as it is a very specific entry (not only “the ignore proxy for host” configuration).

Cheers!

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [December 1, 2022, 6:46pm UTC](https://community.gatling.io/t/proxy-with-gatling-doesnt-consider-localhost-traffic/7358/7 "2022-12-01T18:46:12Z")

</div>

Could you please share which browser you’re using and a screen shot of your proxy configuration?

If you’re using Firefox, the “No proxy for” box should be empty like in the documentation: [Gatling - Recorder](https://gatling.io/docs/gatling/reference/current/http/recorder/#listening-proxy-port)

---

<div class="post-metadata">

**Author:** ![ArthurG](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@ArthurG](https://community.gatling.io/u/ArthurG)\
**Post date:** [December 2, 2022, 7:58am UTC](https://community.gatling.io/t/proxy-with-gatling-doesnt-consider-localhost-traffic/7358/8 "2022-12-02T07:58:48Z")

</div>

This is my proxy configuration.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/5/54a4245c08b1018b4e68854144e10e7b1033f9e2.png)

But I think proxy bypass localhost (like said @sbrevet ). Look:  
" Les connexions à localhost, 127.0.0.1/8 ou ::1 ne passent jamais par un proxy."

I will find an other solution !  
Thank you.

AG

---

<div class="post-metadata">

**Author:** ![sbrevet](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/sbrevet/32/830_2.png) [@sbrevet](https://community.gatling.io/u/sbrevet)\
**Post date:** [December 2, 2022, 8:17am UTC](https://community.gatling.io/t/proxy-with-gatling-doesnt-consider-localhost-traffic/7358/9 "2022-12-02T08:17:25Z")

</div>

Did you try with the external ip address of your computer? (192.168.0.x I guess, but it depends on your network).

Note that your application will have to listen to external endpoint as well.

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [December 2, 2022, 12:47pm UTC](https://community.gatling.io/t/proxy-with-gatling-doesnt-consider-localhost-traffic/7358/10 "2022-12-02T12:47:35Z")

</div>

> " Les connexions à localhost, 127.0.0.1/8 ou ::1 ne passent jamais par un proxy."

Oh right, I failed noticed this change in FireFox settings ☹

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/b/b148e0742de35c6280726cabf3ecd3de2d320f63.png) [@system](https://community.gatling.io/u/system)\
**Post date:** [January 1, 2023, 12:48pm UTC](https://community.gatling.io/t/proxy-with-gatling-doesnt-consider-localhost-traffic/7358/11 "2023-01-01T12:48:01Z")

</div>

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