Hey Everyone, I am trying to setup wiremock with m...
# general
s
Hey Everyone, I am trying to setup wiremock with my emulator to capture and modify(similar to what mitmproxy does) http and https request for android native app. 1. I have installed the certificate in emulator. 2. I want to only intercept 2-3 any call (there are 100s of different call to different host). So basically want to whitelist every other call except the ones I wan to put stub for.
Copy code
HashMap<ExecutionDataKeys, Object> executionStates = new HashMap<>();
WireMockServer wireMockServer = new WireMockServer(
        new WireMockConfiguration().port(8080)
                .notifier(new Slf4jNotifier(true))
);
wireMockServer.start();
ArrayList<String> hostNames = new ArrayList<>(
        Arrays.asList(
                "<https://host1.com>",
                "<https://host2.com>",
        ));

hostNames.forEach(host->{
    wireMockServer.stubFor(any(urlMatching(host+".*"))
            .atPriority(10)
            .willReturn(aResponse().proxiedFrom(host)));
});
I have also set proxy in emulator to localhost:8080. But it seems whitlisting is not working. all of my request are getting blocked. P.S. I am trying to use appium along with wiremock to test state changes in application
r
Answering in #wiremock-open-source It's hard to keep track of conversations when you cross post the same one to multiple channels.