Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2008-10-26
10:46 • New ticket [2197293fff] ::http::geturl could support FTP if using an HTTP proxy<... artifact: 3e9bb593c2 user: nobody

::http::geturl could support FTP if using an HTTP proxy

Deleted2197293fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 18 years ago
Descriptionplain2008-10-26 10:46:23
The `http' package, actually, could support ftp:// URLs if an HTTP proxy is in use.  Consider, e. g., the following hack:

$ tclsh8.4 
% package require http 
2.5.2
% ::http::config -proxyhost localhost 
% ::http::config -proxyport 1313 
% ::http::register ftp -1 ::socket 
-1 ::socket
% set url ftp://ftp.ssec.wisc.edu/pub/eosdb/ancillary/2008_10_26_300/gdas1.PGrbF00.081026.00z
ftp://ftp.ssec.wisc.edu/pub/eosdb/ancillary/2008_10_26_300/gdas1.PGrbF00.081026.00z
% set token [ ::http::geturl $url -validate 1 ]
::http::1
% set ${token}(meta)
...
Content-Length 23975196
Last-Modified {Sun, 26 Oct 2008 07:07:55 GMT}
...
Proxy-Connection close
% 

(Note the explicit use of a bogus `-1' port number.)

Why not to make ::http::geturl skip most of the checking of the URL if an HTTP proxy is in use?  These checks are quite superflous, given that the complete URL have to be passed to the proxy server, and it seems like a good idea to pass it unmodified.

Ivan Shmakov, [email protected]
Log in (anonymous is fine) to add a comment.