Automatically detecting proxy setting... How?

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Automatically detecting proxy setting... How?

Post by Simon » Wed Jun 11, 2008 8:03 pm

Hello,
I've seen a lot about people doing this but no code to support it. Is it really just reading ("HKEY_CURRENT_User\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer") and putting that into HTTPproxy?
Or is there another method that uses IE Automatic Detect Proxy settings?

Thanks,
Simon

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Thu Jun 12, 2008 12:01 pm

Hi Simon,

from the docs:
...
If the HTTPProxy property is empty, requests are sent directly to the host server and no proxy is used. This is the default setting.
!!!(On Windows systems, if a proxy server is set in the registry, that setting is used as the default.)!!!
...

Does that not what you need?


Best

Klaus

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Post by Simon » Thu Jun 12, 2008 5:17 pm

Hi Klaus!
If it is supposed to be defaulting to the registry settings it's not working for me as I'm getting reports back that the client is still unable to connect. Is there some scripting I have to do to make it active? Doesn't look like it.

Thanks for your thoughts.

Regards,
Simon

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Thu Jun 12, 2008 5:52 pm

Hi Simon,

ah, I see, sorry, I thought it would be that easy :-)
But if it does not work, then this could be a bug and should be godzillaed.


Best

Klaus

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Post by mwieder » Thu Jun 12, 2008 6:28 pm

I hate proxy servers.

However, my experience is that rev does indeed follow the Windows registry proxy server settings. Note that there's a ProxyEnable key in addition to the ProxyServer key. And that IE's cacheing may affect things as well.

These *are* http requests you're trying to send, right? Not some other protocol?

For troubleshooting Windows network things, check out HTTP Analyzer from www.ieinspector.com (the trial version will do the trick) and ngrep from ngrep.sourceforge.net (free commandline tool).

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Post by Simon » Thu Jun 12, 2008 6:52 pm

Hi mwieder,
Thanks for the input.
Yes these are http requests.

So, you are saying that without any action on my part rev will find the proxy information for Windows? But that sometimes there are other 'things' that get in the way? Right?

Thanks,
Simon

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Post by trevordevore » Thu Jun 12, 2008 8:31 pm

Unless the computer is using a static ip address Revolution will not work properly out of the box. You mentioned auto detect in your first post. Is the what the computer is set to use?
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Post by Simon » Thu Jun 12, 2008 10:19 pm

Hello Trevor,
Well now I must be a real Rev user. Pleased to finally meet you.
The Registry entry up above was just a question, no I have not implemented it. And as for IE auto detect goes, this client yes, they do have auto detect on.

Thanks for your help on this.

Regards,
Simon

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Post by trevordevore » Fri Jun 13, 2008 4:34 am

Pleased to meet you as well Simon.

Here is what I think you are up against. There are at least two things going on here that will need to be addressed:

1) Web Proxy Autodiscovery Protocol (WPAD)
http://en.wikipedia.org/wiki/Web_Proxy_ ... y_Protocol
2) Proxy auto-config (PAC)
http://en.wikipedia.org/wiki/Proxy_auto-config

If the Windows computer is set to auto discover proxy settings then the WPAD protocol is probably being used to locate the PAC file on the network. Once the PAC file is located it must be processed in order to get the IP address of the proxy server. This IP address is what you would assign to the httpproxy property in Rev.

Let's work backwards. As of 2.9 there is an unsupported function called httpProxyForURL. If you look at the Engine Change Log.txt file in the Revolution application folder you can read up on it. The basic idea is that you can pass in a url along with a PAC file and httpProxyForURL will return the IP address that you can assign to httpproxy.

httpProxyForURL works well as long as the PAC file uses standard Mac/Win encodings. UTF-8 can make it choke though. Runtime is aware of this.

That brings us to WPAD. I haven't implemented anything in Revolution myself but this is something I am interested in myself. I have been working with proxy serves and PAC files quite a bit lately with the GLX Application Framework and I would like to get auto detection incorporated if possible. It would be interesting to know if anyone around here has experience with the WPAD protocol and could help come up with a solution in Revolution.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

Post Reply