Proxy help
how do i...
Monday, March 27, 2006 by Kevison | Discussion: DesktopX
Reply #2 Monday, March 27, 2006 9:39 AM
Reply #3 Tuesday, March 28, 2006 9:12 AM
Are there any sample code to show this coding? My own attempts for whatever reason do not seem to work. Kind of wished I hadnt trashed the objects...

Reply #4 Tuesday, March 28, 2006 1:02 PM
var winHttpReq = new ActiveXObject("WinHttp.WinHttpRequest.5.1");
PROXY_SERVER = document.all.serverName.value + ":" + document.all.serverPort.value;
winHttpReq.SetProxy(HTTPREQUEST_PROXYSETTING_PROXY, PROXY_SERVER, "");
winHttpReq.Open("GET", "https://www.someplace.com", false);
winHttpReq.SetRequestHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)");
winHttpReq.Send();
This will submit a request to the server and the results can be displayed through calling
winHttpReq.ResponseText
Reply #5 Wednesday, March 29, 2006 7:37 AM
Reply #6 Wednesday, March 29, 2006 9:46 AM
| or do i need something in the pref's to say "use proxy" |
You would need something that allowed your users to choose whether or not to use a proxy because they would need to enter the proxy server name and port.
Oh, and since I forgot to post this with the original code, you'll need some of these and you can get the description for them at MS's MSDN site.
// HttpRequest SetCredentials flags.
HTTPREQUEST_SETCREDENTIALS_FOR_SERVER = 0;
HTTPREQUEST_SETCREDENTIALS_FOR_PROXY = 1;
HTTPREQUEST_PROXYSETTING_DEFAULT = 0;
HTTPREQUEST_PROXYSETTING_PRECONFIG = 0;
HTTPREQUEST_PROXYSETTING_DIRECT = 1;
HTTPREQUEST_PROXYSETTING_PROXY = 2;
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Monday, March 27, 2006 8:47 AM