Cordova - connecting to a proxy server - android

I have a cordova application targeting both iOS and android platforms. Under certain conditions, when the user, who is in a specific group, logs in to the application (using normal his data plan), I want all the HTTP calls to be router through a proxy server which has an authentication based on username and password. I need to know how do I enable the application to connect to a proxy.
thanks

Related

My Android app cannot connect to localhost after setting APN

I have setup a local server running on 127.0.0.1/3000 on my MacBook. My Android app sends requests to 10.0.2.2/3000 to make connection with the server. This works pretty well until I configured the APN in the Android emulator settings. In the APN settings, I set the Proxy to be 192.168.x.xxx and the port number to be 8001. With these settings, the local server is not able to accept any messages sent from my app now. Closing the APN proxy is not an option because my app also needs to connect to some remote services. So how to connect to the local server with APN proxy on?
I find the answer. Instead of listening on 127.0.0.1/3000, I configured my local server to listen on 0.0.0.0/3000. Instead of making request to 10.0.2.2/3000 in my Android app, I now make request to 192.168.x.xxx/3000. The local server now can accept messages sent from my Android app.

how to monitor the traffic of an android

I have an android phone that I want to monitor the HTTP/https traffic using tools like CHARLES PROXY
but the phone not on the same network as the CHARLES PROXY host. is there a way to do that without using an external server?
There is no need for an external server. You need to route the traffic from your phone to the device where the intercepter is running. You could create a mitm setup with a tool like https://mitmproxy.org/. Btw you will need a routed phone, something like xposed-ProxyOn.. Then you can intercept app specific traffic. But if you try to intercept https traffic from apps they use certificate pinning you wont get a connection to the app server

How to log HTTP and HTTPS traffic for mobile devices like Android and iOS?

I have the following setup:
Mobile Clients (Android and iOS) are communicating with 3 servers directly using HTTPS rest requests with json body.
I want to host a server in the middle and send all requests when the application is used in one of the non-PROD environments and log every request and response. In real time the developers or QAs to open a web page and see in real time every activity the application is doing.
Also: Apply some filters, for example only requests to a specific address, or everything but specific address. Apply delays and change the request/response body or status code - like in Fiddler.
In order to achieve this today I have to host Fiddler or Charles proxy and setup the computer as proxy server to every device.
What can you advise me to use?
You can host a Fiddler proxy on your server. Also in the Fiddler settings, don't forget to mark the 'Decrypt HTTPS' setting if you want to see the HTTPS traffic.
Fiddler will give you a certificate which you will need to install on mobile devices so that Fiddler can decrypt HTTPS connections.
Set your proxy in the Wifi settings.
Make sure that your app uses the proxy settings which are set in the Wifi Settings. I have seen some apps which ignore the proxy settings.
you can setup a wifi proxy server and ask all the the devices to connect through that wifi proxy server...Now you can monitor traffic on that proxy server...
On Linux server you can use squid to setup wifi proxy -http://computernetworkingnotes.com/network-administrations/squid-server.html
To setup wifi proxy on android device go to Go to Settings/Wi-Fi-> "Show advanced options"-> "Proxy settings" and choose "manual"

Communication between app and server over cellular network

I'm developing an Android application that communicates with a Rails server. When the application is run on the same network as the Rails server, everything works well (I can access my database on the server). However, when I use the 4g internet on my phone, I can't connect with the server.
My question is, how can I modify my Android app/Rails server so that my Android app can contact my rails server without having to be on the same network?
Thanks in advance!
Make sure you're not starting the server in development mode. Generally, in development mode the server accepts by default only requests from the same machine (no network connections are accepted).

Intercept Android GMail SSL connection

Is it possible to route android gmail app traffic through my own HTTP proxy?
I know that I can install certificates onto android phone but I am not sure if gmail app has hard coded certificate information?
I was able to use Fiddler with Android ICS by changing proxy settings on wi-fi network

Categories

Resources