Charles not working ,pop up "Allow" or "Deny" not coming - charles-proxy

1.Using Charles 4.2.6 version
Settings made:
2.Port number in Proxy setting < proxy < Http proxy :8888
3.enter image description here
4.SSL Proxing setting < SSL Proxing < Enable SSL proxing < added :
5.Added VPN ip address in Access Control Setting
6.Installed and trusted Charles root certificate in windows system and my iOS device (XR Version:13.2.3)
7.Installed my test build
8.Changed ip address in configure device proxy (tried with VPN IP address and Normal IP address shown in Charles) Port 8888
9.Launched the test app
10.Traffic is not coming from test app to Charles.
11.Tried to uninstall and install Charles many times
12.Downloaded Charles root certificate in mobile through system (IE. transferred from system to mobile then trusted the certificate and enable the toggle)
13.Getting system calls
enter image description here
Prompt "allow" or "deny" is not coming after mapping ip address in iOS device.

I had same issue.
I used AppCleaner to completely remove charles along with config/preferences.
And installed again, works fine now.

What worked for me was restarting my router and do all these steps again.

Related

Why can't I enter the url on my phone's browser to view my live site?

I use an extension called Live Server in Visual Studio Code. When I run live, the browser opens and the url is http://127.0.0.1:5500/index.html. Why can't I open this url on my phone's browser to see the live site on the phone. Is there a way to do this (Live reload on phone and browser)?
Note: I also develop using ionic and when I ionic serve I can see it on browser and when I open the ionic dev app (not ionic view!), I can see the live app on the phone. I can view it on multiple devices with the condition of all devices being in the same network which I am fine with.
127.0.0.1 is a special-purpose IPv4 address reserved for loopback purposes. That is, this IP refers to your computer itself.
By entering http://127.0.0.1:5500/index.html in your browser, you're requesting web page within your computer.
In normal case, your computer will be in a NAT network (under same wi-fi AP for instance), and you'll be assigned with a virtual IP. Normally it's 192.168.x.x.
You may enter the following command in your command prompt to see your IP address.
ipconfig
If you're using Mac or Linux, use this instead.
ifconfig
As a result, under your network interface card, you'll get your IP Address.
If the IP address belongs to virtual IP, then you may access it with your phone using
http://< Your IP Address >:5500/index.html
If it's not virtual IP, it is Public IP. Then, you'll have to configure appropriate Firewall settings under this circumstance.
Hope this will help.
You cannot open the same url on your phone, because that url host (127.0.0.1) refers to the localhost (the same machine).
If your phone and server are on the same network, you can replace the current host with the servers local IP.
So if your servers local IP is: 192.168.0.36
the URL you enter in your phone should be http://192.168.0.36:5500/index.html.
I had a same problem.
Solution: Control Panel -> Windows Defender Firewall -> Allow an app or feature through Windows Defender Firewall -> Allowed "code.exe" app.
Run ipconfig and find your private IP.
Make sure your phone is on the same network.
go to http://192.168.0.***:5500/
Open Live server's settings.json and add these two settings "liveServer.settings.useLocalIp": true and "liveServer.settings.host": "localhost". Then type your localhost ip in your mobile browser (in my case it was 192.168.0.110) with the rest of the Live server URL i.e. 192.168.0.110:5500/index.html. This worked for me.
Let me clear this out for you. we call localhost or 127.0.0.1 as loop backs. which will itself point to the same machine(means that particular service should also be hosted in the same machine). what Microsoft did with visual studio live share is that if have the live share extension it will create a reverse proxy between the host(where the server is hosted) and the target (In this case your browser) which means even though your host is in a different country the extension will tunnel the transparent proxy to your loop-back address. visual studio live share extension is what you phone doesn't have and Microsoft doesn't support yet. If you still want to access your local service what you can do is turn off the firewall(or pass through that particular port where ur service is hosted) and connect your phone to the same network as your machine with the service running and instead using http://127.0.0.1:5500/index.html use http:// UR SERVER IP :5500/index.html you can get UR SERVER IP by giving ipconfig in windows command prompt or ifconfig if ur server is on linux.

Fiddler 4-iOS 10.2.1 cannot reach internet after configure proxy

I am following this instruction http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/ConfigureForiOS. Everything works until section Set the iOS Device Proxy.
Once I set the proxy on my iPhone, I can't connect to the internet from the phone anymore. Not even accessing the echo page, which I could access before turning on the proxy on the phone. I already installed the root cert on my phone, the makecert add-on on Fiddler
Could someone help with ideas to diagnose the issue here? Thanks,
What might be stopping your iphone from reaching your Fiddler machine on the port specified, usually 8888?
Have you a firewall on the Fiddler machine? You might need to open
the port.
Does your LAN have an automatic redirect to a login page? Ours
does, so I have to disable the proxy on the iphone while I login,
then reenable it.
Does your LAN expose the IPs of cable-connected machines to WIFI
users? Not all do.
Can you browse a simple web page on your Fiddler machine from your
iphone, before starting fiddler or doing any proxy configuration?
You might need to get really serious and install a ping utility on the iphone.

iPhone: add entry to /etc/hosts without jailbreaking

For my development process I need to access a webserver which is behind a VPN and has no DNS entry.
What I was doing on 4.x was to edit /etc/hosts on the iPhone, and add it to the hosts file.
Now I'm on 5.0 beta, and don't want to jailbreak for now just for this purpose.
Is there a way I can add a line to /etc/hosts, just for development purposes (the final, distribution application does not need this hack), without jailbreaking? Can I use other means (declare a fake DNS entry by some unknown means at application launch, for example)?
EDIT: If you're willing to purchase a small license, I recommend using Charles Proxy, a web debugging proxy tool. It will also resolve domains from your local /etc/hosts, and it gives a lot of bonus features (i.e. inspect requests/responses and throttle network speeds). I only stumbled upon this tool from a WWDC video and I'm not affiliated with the product at all. I recommend reading Chris Ching's tutorial for iPhone and Charles Proxy to get you started.
To add to Ramon's answer, a way around it is to setup your local computer as a DNS server and have your iPhone point to your computer as a DNS server. This would also work for Android devices as well
The instructions are for Mac OSX via Homebrew:
brew install dnsmasq
dnsmasq is a lightweight dns server that will fallback to the original DNS server when it encounters an unknown domain
Add the line address=/.your.domain.com/10.0.0.5 to the file /usr/local/etc/dnsmasq.conf
The IP Address 10.0.0.5 is whatever the IP address assigned to your local computer by your router. You can find this via Network Utility (if you want to be fancy, you can assign a static IP to your local computer in your router)
sudo dnsmasq
This starts dnsmasq process, and it will listen on the DNS ports
Assign your local computer and your router as your DNS servers for your computer via System Preferences -> Network -> Advanced -> DNS Tab
You'll have two entries, one for your local computer (127.0.0.1) and one for your router. The reason why you include your router's IP is dnsmasq will fulfill unknown entries through the other known DNS servers. Without the router entry, you're whatever devices connected to you dnsmasq won't know how to connect to the internet.
Set your local computer's IP Address as your DNS Server your iPhone, go to Settings -> Wi-Fi -> Info icon for your connected router -> DNS
Some things to consider:
If you shut down your machine, your iPhone won't connect to the internet anymore. Make sure to reset your iPhone's DNS server to your router's IP
By default dnsmasq will look at your /etc/hosts, so if you had pointed your.domain.com to 127.0.0.1, your iPhone will resolve your.domain.com to 127.0.0.1, which means you won't connect to anything. To change this behaviour edit uncomment the #no-hosts line in the dnsmasq config.
Sources
http://www.davesouth.org/stories/how-to-set-up-dnsmasq-on-snow-leopard-for-local-wildcard-domains
Set up a real DNS entry, either by setting up a local DNS server on your wireless network, or by using a dynamic DNS service, or by adding an A record to a domain you control DNS for.
You can also set up dnsmasq (available from macports/brew), it acts as a DNS forwarder which allows you to set all kinds of alternative records.
You can then set up the DNS on the iphone/ipad to point to the box running DNSmasq, and any host on /etc/hosts on the dnsmasq box will be returned first. If not found, dnsmasq will send the query to the upstream DNS.
Also you can add SRV records to dnsmasq.conf:
srv-host=_sip._udp.devel.foo.com,devel.foo.com,5070
And many other niceties.

Connect an Android Device To a Web Service on Local Host

I implemented a web service for an Android application. The web service is running on my local host (192.168.1.2). Using the Android emulator I succeeded to connect to web service. The I tried to connect my Android device using debugging mode to web service but it didn't work. So my question is if it is possible to connect an Android device to this web service that is running on my local host (192.168.1.2) without using a real IP ?
It's much simpler way supported by google!
Connect your phone via usb to computer and enable usb debugging
On your computer open Chrome browser and type exactly this address: chrome://inspect/#devices
Now you can link your computer port to your device port by port forwarding button. On my computer I have service on address localhost:61437 and I just linked it to device's 8081 port. Remeber to check 'Enable port forwarding' checkbox
screen from service on my computer ( localhost:61437 )
screen from my mobile browser with the same service ( localhost:8081). And that's it. Also you use this service address in your application
Did you already solve your problem? I also got a problem like you. These are the steps that I already done:
unplug lan cable or turn off any other internet connection from your pc.
connect your android mobile to your pc using usb.
turn on usb tethering
back to your pc. check your ip. mine is 192.168.42.37
check your webservice app in your pc. let's say http://192.168.42.37/webserviceapp
back to your android mobile. try this url http://192.168.42.37/webserviceapp
Now you can access your webservice app in your pc from your mobile phone.
Well your localhost is 127.0.0.1 (or ::1) and your LAN IP is 192.168.1.2. Each pc/device that are connected under your LAN could reach your webservice on IP 192.168.1.2
Your Android device must be so connected under the same LAN maybe through Wifi connection so it will be able to talk with 192.168.1.2.
If you can't connect your Android device under the same LAN eg you have just a 3g connection you need to play with your router/firewall to redirect all incoming traffic (maybe just the http traffic) from your public ip to you private ip (192.168.1.2)
Hope this help
I'll throw in my process, since nothing on SO worked for me. Here are the steps I took to connect my physical android device to the web service running on my laptop (connected to the phone) on localhost:
Enable USB debugging on your Android device
Run your web service on your machine. My web service runs on localhost, port 3000 in development: http://localhost:3000/api/...
Run ifconfig (Unix), or ipconfig (Windows)
Find your machine's inet address on your LAN interface. Mine is 10.0.0.121 for interface wlan0. Externally, it is 68.43.XX.XXX, which is not the address that you want to use.
Use the LAN IP since you are connecting to your service on LAN, otherwise you might get an econnrefused (connection refused) error due to firewall rules
Build your http URL with that IP address, and the port that your web service is running on. For me, it's http://10.0.0.121:3000/api/...
When you launch your app, you should connections to your local web service in logs, Wireshark, etc, and you should see the desired activity/data in your Android application.
I had the same issues, researched a lot then found out that you have to explicitly make changes in your firewall settings. Your firewall is blocking your code to be accessed from external source. So, all you need to do is, go to firewall settings, add port 80 (in my case since, I am using Apache http Server) for inbound and outbound. Now, you can test it on your phone's browser http://192.16..**:80/
I've done that on a Mac using GasMask and Charles Proxy Server. Your phone and your computer have to be on the same network.
say the webservice url you want to access is at http://api.xyz.com, you first use GasMask to point that url to your localhost, then use Charles to set up a proxy server. Then you go to the settings on your phone, go into Wi-Fi, long-press the network you are connected to, choose Modify Network, and enter the proxy settings Charles gave you.
In my case, nothing of these solutions works because Windows firewall blocks it, but putting a rule on the firewall hasn't effect.
The problem in my case is that my laptop is connected with Wifi and Windows had the Wifi connection like a Public network. I must to change the network connection to Private network. http://www.comofuncionatodo.net/tecnologia/informatica/como-cambiar-de-red-publica-a-red-privada-en-windows-10/
I agree with the other answers as good approaches if you don't want to expose your DEV webservice on the internet. However, it's much easier if you do just expose the webservice. There's a number of free DNS services, but I've found no-ip to be the easiest to set up. I use it for exactly the purpose that you asked about; so I can test with my DEV webservice on a real device.
If you choose to go with no-ip (I have no affiliation with that company, it's just the one I've used and am familiar with), you can get a free publicly accessible URL like http://MyExampleWebServer.no-ip-org, and no-ip has a utility you can install so even if you're behind a dynamic IP, it will always keep the correct external IP associated with that URL. If you're working from your house, then you'd just need to make sure you port forward traffic from port 80 to your internal 192.x.x.x IP address (or whatever port you use; maybe 443 for ssl).
It's as easy as that, and now you can hit that webservice from any device that can access the internet.
I haven't worked with it, but I believe dyndns also offers a similar service.
This solution is for GAE development server in Eclipse
Step 1: Get the LAN IP
Goto your Windows Command Console (Press Win+R, then type "cmd"). In the console, enter "ipconfig". You will see a list of display. Under Wireless LAN adapter Wi-Fi, get the IPv4 Address. It will be something 192.168.x.x
LAN IP : 192.168.x.x
Step 2:
Go to Eclipse, Open the Configured server
Under Properties of GAE Development Server -> Local Interface address to bind to, enter the LAN IP address, and save.
Step 3:
Now you can access the GAE server by
http://192.168.x.x:8888/
8888 - Refers to the Port Number, as mentioned in the GAE development server
In order to access local web services using their own server hosts rather than IP addresses with ports, do these following steps:
Make sure your Android device and your local machine are on the same network.
Install SquidMan on your Mac, Linux, or any other Proxy Server.
Configure the proxy server's HTTPPort (ex. 5555) and clients (ex. 192.168.0.0/24) to your own network mask, and run the proxy server.
You are either using the web services in:
a. A web browser: Configure the proxy settings of your Android device from Modify WiFi networks.
b. Android application:
Set up the Proxy for your HTTP client. If you are using Volley, check this out: Volley Behind a Proxy server.
You can now connect to it by using whatever URL you are using on your host to connect to the web service (ex. http://my-local-machine.com)
Hint: If you got 4xx response codes, make sure your web service allows connections from other non-local-hosts.
If you are referring your localhost on your system from the Android emulator then you have to use
http://10.0.2.2:8080/
Because Android emulator runs inside a Virtual Machine(QEMU) therefore here 127.0.0.1 or localhost will be emulator's own loopback address.

Remote access to apache2 server

I'm trying to test my iPhone application on the device.
I have a mac computer which stores my development environment.
Right now I can only access PHP files using the http://localhost/PHPFileLocation
which does not work when I try to test my app on real device.
How do I configure apache2 to be accessible from outside?
Is it possible to configure it to a specific IP address?
I want to reach some php scripts located on my development machine running apache2 from my iPhone device.
Thanks
If your computer has a WiFi card then you should be able to attach the iPhone remotely to a ad-hoc Wifi network created on your dev machine.
I'm assuming your Mac is behind a router. You should be able to configure your router to port forward connections to your WAN facing IP address to port 80 (the HTTP port) on your Mac - see http://portforward.com/ for some help.
You may also need to turn the firewall off on your Mac.
Once this is set up correctly you can hit http://yourexternalIP/PHPFileLocation in your iPhone app and this will be directed by your router to the Apache2 server on your Mac. The external IP is normally found on your router's admin page somewhere.