|
Prev: Autoproxy behind a corporate firewall that uses a website to configure proxy
Next: Why is this regular expression invalid in Expect? (where it is valid if I use regexp)
From: Pat Thoyts on 26 Jun 2008 07:18 jalitt(a)gmail.com writes: >Hello, > >I am a tcl user behind a corporate firewall. I'd like to develop an >app that communicates with a server outside of the firewall, and I'd >like to write this app in tcl. The only problem is that autoproxy >does not work because my company stores proxy info on a website. IE >knows the url and uses it just fine, but autoproxy seems unable to do >so. Is there anyway to grab the proxy info from that site and >configure the http package accordingly? A general solution to this is to use IE or the XMLHttpRequest object via its automation interface as these IE objects already know how to read such proxy information. Using libcurl might be another solution. In http://www.patthoyts.tk/programming/tclole05src.zip there is a rough re-implementation of the http package using MSXML.XMLHTTP as the transport to work with proxies on windows like this. It may be worth examining (library/http.tcl and demo/*) -- Pat Thoyts http://www.patthoyts.tk/ To reply, rot13 the return address or read the X-Address header. PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD
From: Glenn Jackman on 26 Jun 2008 09:57 At 2008-06-25 11:19PM, "jalitt(a)gmail.com" wrote: > Hello, > > I am a tcl user behind a corporate firewall. I'd like to develop an > app that communicates with a server outside of the firewall, and I'd > like to write this app in tcl. The only problem is that autoproxy > does not work because my company stores proxy info on a website. IE > knows the url and uses it just fine, but autoproxy seems unable to do > so. Is there anyway to grab the proxy info from that site and > configure the http package accordingly? Mine does too: http://proxy.company.com/proxy.pac Have a look at the page. Mine has a FindProxyForURL function that performs various tests to determine if the URL is internal. If yes, it returns "DIRECT", otherwise it returns a string like "PROXY proxy-abc1.company.com:8080" Use that hostname and port for your proxy. You might have to supply a username and password. -- Glenn Jackman Write a wise saying and your name will live forever. -- Anonymous
From: Glenn Jackman on 27 Jun 2008 11:39 At 2008-06-26 02:49PM, "jalitt(a)gmail.com" wrote: > Glenn, my corporate firewall returns a similar .pac file with a > similar FindProxyForURL function. How can this function be called > from tcl? I don't know -- is there a javascript interpreter written in Tcl? However, fetching and parsing it is simple: package require http set get [http::geturl http://proxy.example.com/proxy.pac] set contents [http::data $get] http::cleanup $get regexp {PROXY (\S+):(\d+)} $contents -> proxy_host proxy_port -- Glenn Jackman Write a wise saying and your name will live forever. -- Anonymous
From: marc spitzer on 29 Jun 2008 20:35
On 2008-06-27, Alexandre Ferrieux <alexandre.ferrieux(a)gmail.com> wrote: > Pat, would you be so kind as to answer my question on libcurl ? > > -Alex I am not pat, but with that said, libcurl does not handle javascript. But it may help you get through the proxies after you use tcl to strip out the bits needed from the JS you downloaded with libcurl is my guess. Thanks, marc -- ms4720(a)sdf.lonestar.org SDF Public Access UNIX System - http://sdf.lonestar.org |