appium / mitmproxy-java

A bridge between Python's mitmproxy and Java programs. Built on top of mitmproxy-node
Apache License 2.0
64 stars 20 forks source link

Unable to capture request and response in iOS execution using appium and java #10

Closed yadsandy closed 1 year ago

yadsandy commented 3 years ago

Problem Description I am trying to run my java code from appium script in eclipse and using mitmproxy to capture the requests. Whenever I start the test execution, the eclipse console showing me all the request and response code but it is not capturing in InterceptedMessage.

System Information The logs which I am receiving on eclipse console: [Thread-10] INFO io.appium.mitmproxy.MitmproxyJava - 127.0.0.1:52111: POST https://outlook.office.com/owa/service.svc?action=GetAt… HTTP/2.0 [Thread-10] INFO io.appium.mitmproxy.MitmproxyJava - << HTTP/2.0 200 OK 1.37k [Thread-10] INFO io.appium.mitmproxy.MitmproxyJava - 127.0.0.1:52136: clientconnect [Thread-10] INFO io.appium.mitmproxy.MitmproxyJava - 127.0.0.1:52136: POST https://teams.events.data.microsoft.com/Collector/3.0/?… [Thread-10] INFO io.appium.mitmproxy.MitmproxyJava - << 200 OK 0b

my mitmproxy version Mitmproxy: 6.0.2 Python: 3.9.1 OpenSSL: OpenSSL 1.1.1j 16 Feb 2021 Platform: macOS-11.2-x86_64-i386-64bit

and the method which I am using to capture the request is: private MitmproxyJava proxy; public IOSDriver captureIosSimulatorTraffic(String appLocation) throws IOException, InterruptedException, TimeoutException { List messages = new ArrayList(); // remember to set local OS proxy settings in the Network Preferences proxy = new MitmproxyJava("/usr/local/bin/mitmdump", (InterceptedMessage m) -> { System.out.println("intercepted request for " + m.getRequest().getUrl().toString()); messages.add(m); return m; }); proxy.start(); }

leibingguang commented 3 years ago

@yadsandy Are you fix it? how about share

rychtak commented 2 years ago

I have exact same issue - tried on MAC and Windows configuration with Android real device

Does anyone fixed it?

rychtak commented 2 years ago

It work's for me now.

I want'ed to run mitmdump with -no-http2 option and I have used bash executable file to run mitmdump, but it suppose to point to '/usr/local/bin/mitmdump' executable.