Log In
Sign Up and Get Started Blogging!
JoeUser is completely free to use! By Signing Up on JoeUser, you can create your own blog and participate on the blogs of others!
kevison
Proxy help
how do i...
Published on March 27, 2006 By
Kevison
In
DesktopX
How do I deal with proxies? I havent found a way to work around them.
Article Tags
desktopx
Popular Articles in this Category
Popular Articles from Kevison
Slowness feedback
Comments
1
Kevin_C
on Mar 27, 2006
For what? creating widget? Using widgets? If it's the latter the widget would have to be coded to support connections through a proxy server.
2
ZubaZ
on Mar 27, 2006
At one point I thought that Widgets leveraged the IE settings. Now, I'm not sure.
3
Kevison
on Mar 28, 2006
Sorry yes I ment through widgets. I thought they leveraged the IE settings too but doesnt seem to be true in my case. I tried making OD objects but they didnt work either behind a proxy.
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...
4
Kevin_C
on Mar 28, 2006
Here's a snippet of how to make HTTP requests using a proxy
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
5
RomanDA
on Mar 29, 2006
Does that work if there is no proxy? Meaning if i make a gadget and some people have a proxy and some don't will it work for both? or do i need something in the pref's to say "use proxy"?
6
Kevin_C
on Mar 29, 2006
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;
7
Kevison
on Mar 29, 2006
awesome I will give that a try
thanks!
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.
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!
Sign Up Now!
Meta
Views
» 1910
Comments
»
7
Category
»
DesktopX
Comment
Recent Article Comments
Let's start a New Jammin Thr...
LightStar Design Windowblind...
Welcome to 2025!
Which A.I. Software Are You ...
Adventures With MacOS
Modding Ara: History Untold
DeskScapes 11: The Dream Mak...
ChatGPT 4o vs. o1 vs. o1 Pro...
What's the Last Book You Rea...
A day in the Life of Odditie...
Sponsored Links