While developing on my emulator, I want to hit a server on my local machine, when I connect to 10.0.2.2, but I also want to use my proxy server to get out to the Internet for other connections. Is there a way to do this without running my own proxy server? It's annoying that there's no way to have a list of excluded proxy hosts. Or maybe someone knows how to do that?
I ended up using a proxy server (WireMock) in order to receive all the traffic, and then with mappings I can decide where to proxy the request to. Either a service running locally, or a service that runs somewhere else. It's nice that WireMock can also use another proxy server to get the request to the final destination.
I can differentiate the different proxied endpoints using different mappings with different ports. If I want to use a real device I can use 'adb reverse' to send the request over USB even.