I am using Charles to intercept and rewrite a certain query in proxified HTTP requests as following:
HTTP request --->> Proxifier --->> Charles Socks proxy ---->> HTTP proxy --->> HTTP server
The problem is that after rewriting HTTP requests, Charles sends them directly to the HTTP server ignoring the fact that they are proxified. I have compared the original proxified HTTP requests (without Charles interception) with the Charles-rewritten HTTP requests in Wireshark and found out that the HTTP proxy IP/port changed to the HTTP server IP/port! certainly as a result of Charles doing unnecessary DNS lookup based on HTTP server hostname, How to go about this problem?