Charles Proxy Not Showing Same as Network on Browser - charles-proxy

I went to browser and went to inspect element (F12) and chose Network, however I'm seeing more in Network than I see in Charles. I went to sequence in Charles and most of the methods I'm seeing there is just CONNECT, a few GET, and a few POST. However in the network section (just viewing JS), I am seeing a bunch of POST methods that Charles isn't showing. Is Charles supposed to show that or is there a reason it's not showing?

Probably your browser is caching many of those resources not appearing in Charles. You can avoid cache by:
Refresh your page with Ctrl + F5, or
Clear caché (in most browsers Ctrl + Shift + Supr), or
Use the incognito mode (in most browsers: Ctrl + Shift + N), or
If using Chrome: open the inspector and select "Disable cache" under the network tab.

Related

How to change response body with Charles?

I am using Charles (http://www.charlesproxy.com) to debug my HTTP requests and now I run into an issue where I am receiving json response which I need to edit to see how my app behaves.
I was looking at Rewrite option but can't really figure out how to change it. Ideal would be to load whole response from disk.
Any ideas how to accomplish this? Thank you.
The Map Local tool is probably what you're looking for. Access via menu Tools | Map Local.... Note, you may need a corresponding rewrite rule (Tools | Rewrite...) to ensure the mime type of your response served from disk and the type your application is expecting. But recent versions of Charles may set the type automatically.
Share how to Enable breakpoints, then change response.
request the link firstly. then enable breakpoint > in the http request right click > choose Breakpoints
2. Menu Proxy > Breakpoints Settings > double click the request link
3. change the Scheme GET/POST > Query *
4. modify the request, change the tab Edit Request > you can change the URL, Headers, Cookies, etc > then click the Execute
5. edit the response: choose tab Edit Response > change the response > click the Execute
Enjoy it. You make it.
Charles Proxy change response
As was mentioned Charles Proxy(4.2.8 version) allows you to change response body using different approaches:
Map Local Tool ⌘ command + ⌥ option + L - Use local files to serve remote location
Map Remote Tool ⌘ command + ⌥ option + M - Modify the request location to map one remote location to another
Rewrite Tool ⌘ command + ⌥option + R - Modify requests and responses as they pass through Charles
Breakpoints Tool ⌘ command + ⇧ shift + K - Intercept and edit requests and responses before they are sent and received
Read more here
Enable breakpoints, then change response. You should press continue/send request to send it before tweak response.

fiddler autoresponder not working

I added a rule (flash file), specified the new flash file I want fiddler to respond with (use instead of the browser one). I've cleared my browser cache, and every time I play the stream, the browser flash file is captured again (instead of auto-responding) with the one saved already!!!
It used to work just fine, but now it appears as if the auto-responder (although checked) is not working at all...it's just a pass-through!!!
As explained in the forum post where you asked the same question
There are three possibilities:
1> The AutoResponder itself is disabled (checkbox at the top)
2> The AutoResponder rule is disabled (checkbox at the left of the rule)
3> The rule you've written doesn't match the target request's URL.
Sharing a screenshot of Fiddler might help me tell you which problem you're encountering.
On the top of the list EricLaw gave in the previous answer, I add a new one:
You need to ensure your Fidler has the "Capturing Traffic" mode enabled. Either press F12 or go to "File" -> "Capture Traffic" and make sure you have a "Capturing.." icon on your left bottom corner.
I had a similar issue, and I solved it by enabling decryption of HTTPS traffic.
You can do this by going to Tools > Options > , then check Decrypt HTTPS Traffic
I had the same problem. I drag-dropped from the left, "main", window into the autoresponder so the "request matches..." column auto-populated. As a sanity check I unchecked "unmatched requests passthrough" to ensure that the match rule was indeed picking it up. If it hadn't nothing would appear in the main window at all. But it did appear so the rule was matching.
The issue with Fiddler is in the "then respond with..." column. Right-click for "Edit Response...", edit the response in the popup window of tabs, press Save, close the box.
When you retry your URL, your edited response isn't returned. Fiddler returns the original response. Even if you Edit Response again, it'll show what you typed in, but it never actually returns it.
To fix, you have to save the intended response to a file on your hard drive and edit it there.

chrome cache removal for single files

recently I had to remove my entire cache to be able to view a webpage I was working on. This is fine I guess but it could be improved by removing specific pages from the cache.
the chrome.browsingData.remove, seemingly has no option for indicating individual pages for removal. I was wondering if this could be done externally, but I am not familiar with the chromium code. I was also wondering if there are any planned changes to the chrome.browsingData.remove implementation.
Many thanks
To remove a single file cache enter its URL into browser and do hard refresh.
If you are working on a webpage and wish to avoid caching (btw, it's recommended! :) You can do it today in Chrome DevTools.
Go to Settings (the icon in the bottom-right corner) and click on it.
Then, you will have an option 'disable cache' - mark it and you done.
Just don't forget to return this state when you done working as chrome will be faster with its caching schema.
Edit 10/Feb/2022: Access the remote dev tools documentation for a whole suit of tools available to override cached files while developing:
https://developer.chrome.com/docs/devtools/storage/cache/
If you are attempting to clear HTTP cached data, which was the original question in the post, then the network log is where it is possible. the guide for that is here:
https://developer.chrome.com/docs/devtools/network/#load
First find the file then release its cacged content by right clicking:
https://developer.chrome.com/docs/devtools/network/reference/#clear-cache
To remove all files (not single files) while in Chrome DevTools you should click on the Dev Tools settings then choose
"Disable cache (while DevTools is open)". This was the first option on the page - it is now (as of Chrome 103 in 2022) under network in Preferences.
Note that these settings are not the main Chrome settings, but are specific to Dev Tools.
You can reach DevTools by pressing F12 while on a web page you want to debug or by pressing Ctrl-Shift-I.
Edited 28 July 2022
If you're building the page dynamically, then during development, you can put a random string at the end of the URL used to load the script.
<script src="path/to/script.js?_=<%=Math.random()%>"></script>
This will cause a cache miss for that file but will use the cache for everything else (subject to cache-control headers and so on). Just remember to remove the parameter before pushing to prod!
UPDATE : 2019, April 20
Lately, I'm working with Chrome browser's inbuilt feature - Overrides. With this feature, we can write code for HTML, CSS, JS, etc directly in the console and see it on the web-page.
Here's a tutorial that might be helpful
Previous Answer :
I'm working with Google Chrome extension Resource Override.
After installing this extension, I'm overriding the resource which I want from the server instead of cache:
STEP #2 : Override the resource which you want fresh from the server:
⭐Important Note - Access the plugin from the developer-console instead of the browser
⭐⭐ I started with this approach but have moved to approach suggested by Lukas Greblikas in the answer above.
Good Luck...

GWT Frame not working in Mozilla Firefox or in Google chrome, but working fine in IE

I am trying to download a file from server. The normal GWT RPC call doesnot allow me to do that, and hence I wrote a servlet to do that job for me. From the client side, I am creating a Frame object, and I set the servlet URL in it, and add that frame Object in my root panel.
When I execute this in IE, a window pops up asking for Save/Open file.
But when I execute the same in a Firefox or a Google Chrome browser, nothing is happing.
I am not getting any request on my servlet/server side.
Here is a slice of the code :-
String servletUrl = "http://localhost:13080/Browser/ui/dataExportServlet?level=ZERO";
Frame frame = new Frame(servletUrl);
frame.setVisible(false);
RootPanel.get().add(frame);
So, can someone please help me out.
This might be related to same origin policy.
Are both servlet and webapp running on port 13080?
If they differ, SOP might fail this.
If I understand correctly, IE has a more relaxed policy so it might work there but not in chrome.
See http://en.wikipedia.org/wiki/Same_origin_policy and Can I disable SOP (Same Origin Policy) on any browser for development?
In Chrome, you can use the Developer Tools (CTRL + SHIFT + I) to check if the IFrame is being added to the HTML, and if the frame's source is being set properly. You should also be able to see what content has been loaded into the iframe.
Alternately, set a breakpoint in your servlet to see if the iframe is being hit at all from Chrome.
I got the solution for this issue.
I removed the frames and added the following code :-
com.google.gwt.user.client.Window.open(url, "CSVDownload", "");
Now, this opens a new browser window, and then I get the pop-up to open/save the server side file in all 3 web-browsers. (IE, Mozilla FireFox, Chrome).
Thanks a lot!!!

Eclipse RAP - Firefox doesn't forget session

We've got an Eclipse RAP application that's behaving a bit strangely in Firefox - two distinct problems.
When you browse around, you can click on a button in one part of the system. This opens a popup window like so:
IWorkbenchBrowserSupport bs;
bs = PlatformUI.getWorkbench().getBrowserSupport();
int style = IWorkbenchBrowserSupport.AS_EXTERNAL;
IWebBrowser b = bs.createBrowser(style, getRandomID(), "Hello world", "");
b.openURL(new URL(...));
where the URL is another servlet in the application. This servlet is in the same runtime, but has nothing to do with RAP - it takes a binary blob from in-memory storage and dumps it in the output stream.
Problem 1: This causes the HTTP session to die in firefox, and shows the "session expired" RAP error page with a link to restart the session.
Problem 2: Now, when you click on the link to restart the session, it shows the application's dialog again, but the session expired error is shown again the moment you do anything. This prevents the user from using the system again, unless Firefox is closed down completely and restarted. A quick peek with FireBug reveals that the JSESSIONID passed by Firefox does not change.
Has anyone seen this before?
How long is the dumping of the stream to the output? May it cause a timeout? As RAP uses Javascript calls, it might be much shorter than the normal timeout time.
For problem 2: Firefox caches a lot of things; and if the Javascript execution hangs, it might cause such problems.
Are these problems present in other browsers? It might be a good idea to check with the internal browser (or any other browser with a different rendering engine).
It turns out that if a RAP application opens a popup window pointing to a servlet in the application itself, inside the current HTTP servlet context, the session is killed. Fixed by creating a dummy HTTP context for the servlet in question.
If you need to deliver content from within the same application, you should use a service handler instead. See this FAQ:
http://wiki.eclipse.org/RAP/FAQ#How_to_provide_download_link.3F