title: How can Android Emulator reach server on local network?
body: <p>I want to connect to a server on my local network (<code>10.134.0.178:80</code>). The ip address of my machine is <code>10.134.3.12</code> and the ip address of the emulator Wi-Fi is <code>192.168.232.2</code>.</p>
  
  <p>Now I found out that you have to use <code>10.0.2.2</code> to connect to a server on your local machine. But the server isn't running on my local machine - instead it is a separate instace on my LAN.</p>
  
  <p>My local machine can reach and ping the server without problems. The emulator not, but the emulator has internet access. So I can access e.g. <em>www.google.com</em>.</p>
  
  <p>How can I connect the emulator with the server? The shown <a href="https://developer.android.com/studio/run/emulator-networking" rel="nofollow noreferrer">redirection rules</a> only apply on port level. So how is this meant to be used? Other solutions only talk about a local server. <a href="https://stackoverflow.com/a/51986677/426227">Only one</a> is talking about a similar case, but this is not working for me (no connection)</p>
  
  <pre><code>netsh interface portproxy add v4tov4 listenport=80 connectport=80 connectaddress=10.134.0.178
  </code></pre>
  
  <p>Additionally, I have to switch server instances (different ips/ports/addresses). So how can I use the Android Emulator in this case? To which address should the webservice calls be made? <code>10.0.2.2</code> or <code>10.134.0.178</code>?</p>