how do I use a proxy with wxhttp?

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
ninja9578
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 236
Joined: Thu Jan 29, 2009 3:33 pm

how do I use a proxy with wxhttp?

Post by ninja9578 »

I know about SetProxyMode... but how to I set the proxy? There is no function for that. I thought that make it used a global proxy and I could set it with wxURL::SetDefaultProxy(_T("127.0.0.1:8888"));, but that doesn't work.

I really want my program to be seen by Fiddler for debugging purposes, and I need to set the proxy to the one above to do so.
spectrum
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Sat Jul 21, 2007 12:17 pm

Post by spectrum »

hi ninja,

this is a really intetresting post.

First of all, is interesting that the documentation don't talk about the SetProxyMode method of wxHTTP.

It is undocumented on the official documentation, probabvly becouse it do nothing.
Looking wxHTTP 2.8.9, and 2.9.0, it only set the "m_proxy_mode" protected boolean, but this variable is no more used in any other place, and i don't see any accessor to retrieve it.

Then on the net you find a nice wiki page that talk about:

void SetProxyMode(bool on)
Set whether or not to use a proxy.

Hehe, but don't show in any place how to use it becouse it do nothing actually.

wxURL::SetDefaultProxy and wxURL::SetProxy are instead well implemented, they should allow a kind of tunneling through the proxy channel.

Try something like

wxURL::SetDefaultProxy("65.111.168.207:3128");
wxURL url("http://noticket.no.funpic.de/license/check.php?key=abcd");
etc etc

greetings
spectrum
Post Reply