I'm trying to use WinHTTP with Charles proxy. When I use the WINHTTP_ACCESS_TYPE_NAMED_PROXY option and URL to Charles, it logs the the traffic going through it. When I'm using the WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY, the connection works, but is not logged by Charles - it is bypassed.
Question is what am I doing wrong?
Initially Charles configured Edge's proxy setting to Manual with it's address. I've changed it to auto, to no avail.
The call I use is
HINTERNET session = WinHttpOpen(nullptr, WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY, WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, WINHTTP_FLAG_ASYNC);
session gets a valid value.
I expect the traffic to go through Charles proxy, and be logged by it.
Answer found: Charles settings were made per user, and the code executed in system user process. Making the settings per machine solved the problem.
Thanks for all who have answered, my bad on missing the point.