I have set up charles proxy on a windows PC. I am using it to monitor network traffic from an Android device. However, there is also traffic from the localhost (windows PC) that gets captured even when browser is closed (due to background applications and services). How do I block that traffic from being captured by Charles proxy?
This problem comes up because CharlesProxy changes the whole proxy system settings on Windows when it starts. By what it's said in the documentation (here) I think you can change this behaviour in CharlesProxy configuration, this means: make Charles to not modify the system proxy when it starts.
Anyways, I guess you are asking for this because too many requests appear on the main view. If this is the case, I would strongly recommend you to use the Focused Hosts option, in the View menu. By focusing hosts you can avoid unwanted http requests to bother you in the monitor panel (here). This will make CharlesProxy to group all unwanted http requests to a "Others" item on the Structure view panel.
To focus hosts you can right-click on a request and select "Focus" or you can manage all the focused hosts in the Focused Hosts item from the View menu.