tcllib - autoproxy problem...

From: Jeff Godfrey (jeff_godfrey_at_pobox.com)
Date: 01/09/05


Date: Sun, 9 Jan 2005 14:15:07 -0600

Hi All,

I've just discovered the autoproxy module in tcllib (autoproxy 1.2.0).
Apparently, it's supposed to take a stab at figuring out your current proxy
settings for internet access, should you be using a proxy...

Anyway, for me it was failing miserably (under WinXP Pro) because of the
value being returned by the following line of code:

registry get $winregkey "ProxyServer"

the code following this call was expecting a return value of the format:

<server>:<port> (in my case --> quantex:8080)

but instead, my return value looks like this:

ftp=quantex:8080;gopher=quantex:8080;http=quantex:8080;https=quantex:8080

This is because in "Control Panel | Internet Options | Connections | LAN
Settings | Advanced", I *did not* have "Use the same proxy server for all
protocols" checked. Instead, each of protocols were filled out
independently. Since they were all filled out with the same info, just
checking the "Use the same proxy server..." option happened to be a quick
fix for me (as it formatted the registry key as expected by the autoproxy
module).

So, it seems that in the above case, the returned registry key needs some
further parsing. I've taken a stab at it below, but as I do very little
"internet programming", I'm not sure if I've made some "unsafe" assumptions.
Specifically:

1. Is it safe to parse this key (in the general case) using [split]?
2. Is the key always semi-colon separated?
3. Am I always after the "http" portion of the key?

The following sample code works for my specific case, but I'd like to get
the package patched. If someone closer to this than me can either validate
the below code (or suggest alternatives), I'll get a patch submitted.

#set reg(ProxyServer) [registry get $winregkey "ProxyServer"]
set reg(ProxyServer)
"ftp=quantex:8080;gopher=quantex:8080;http=quantex:8080;https=quantex:8080"
set serverInfo [split $reg(ProxyServer) ";"]
if {[llength $serverInfo] > 1} {
    foreach record $serverInfo {
        foreach {protocol info} [split $record "="] {
            if {$protocol eq "http"} {
                set reg(ProxyServer) $info
                break
            }
        }
    }
}
puts $reg(ProxyServer)

Thanks,

Jeff



Relevant Pages

  • Re: Restricting Internet use by User Login
    ... etc a lot have used the trick of configuring proxy settings for IE ... > so I can limit what Internet access certain users have? ...
    (microsoft.public.win2000.security)
  • Re: Preventing Internet Explorer Access
    ... Our traffic is being monitored by a proxy that checks the IP and windows login to check if we can access certain sites. ... Using the default settings, all installed Windows apps use the IE settings, so they'll all fail to connect. ... Its not as "all encompasing" as a 3rd party solution would be, or even using an Internet Access Server, where you can literally control access using Windows based authentication, but it will stop the casual user from gaining access. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Assistance setting up test network
    ... My IE settings is set to Automatically detect. ... I do not have internet access from the member server. ... If you just need access to the web, ISA Server with it's Proxy is ...
    (microsoft.public.windows.server.general)
  • Re: Assistance setting up test network
    ... My IE settings is set to Automatically detect. ... I do not have internet access from the member server. ... If you just need access to the web, ISA Server with it's Proxy is ...
    (microsoft.public.windows.server.general)
  • RE: Publish to External FrontPage Server
    ... meaning Auto config, use proxy I am able to connect to the remote website. ... How can I make this work without having to disable the IE settings everytime ... Publish to External FrontPage Server ...
    (microsoft.public.isa)