# Directing Localhost Traffic from Android Through Fiddler Everywhere as a Reverse Proxy

## Environment

|                 |                    |
| --------------- | ------------------ |
| Product         | Fiddler Everywhere |
| Product Version | 1.0.0 and above    |

## Description

How can I configure Fiddler Everywhere to direct localhost traffic from the Android loopback address to the host localhost address?

## Solution

Each Android device and emulator uses special alias like 10.0.2.2 (might differ on different emulators) to your host loopback interface (that is, 127.0.0.1 on your development machine). To direct the traffic generated from the alias address to the desired localhost endpoint, [enable capturing from Android device](https://www.telerik.com/fiddler/fiddler-everywhere/documentation/capture-traffic/capture-from-android) and then use [the Rule Builder](https://www.telerik.com/fiddler/fiddler-everywhere/documentation/modify-and-filter-traffic/modify-traffic-with-rules) to [create a rule](https://www.telerik.com/fiddler/fiddler-everywhere/documentation/modify-and-filter-traffic/modify-traffic-with-rules) with the following conditions and actions:

* A condition where the **Host** contains the mobile loopback address and the Fiddler proxy port. For example: `10.0.2.2:8866`
* An action to **find and replace** the mobile loopback address and the Fiddler proxy port with the desired localhost endpoint on the Fiddler host machine. For example: `localhost:4000`

![Directing mobile loopback to host localhost](https://www.telerik.com/fiddler/fiddler-everywhere/documentation/assets/f333c56739cb19df1f46475ed2046c42/mobile-localhost.png)

Enable the rule and any request on the Android device to `10.0.2.2:8866` will be directed to **localhost:4000**. Fiddler Everywhere is effectively acting as a reverse proxy.
