From: asytnyk@mcscns.cc.telcordia.com Sent: Thursday, May 16, 2002 9:59 AM To: Info-VAX@Mvb.Saic.Com Subject: fetch_http revisited (was: C-Kermit & HTTP retrieve) G'day VMSers! I had been using fetch_http within my scripts for the longest of time and was pleased with its functionality! Then one day it stopped working and I started to scratch my head... Boo! The return was as such... HTTP/1.0 302 Found Proxy-agent: iPlanet-Web-Proxy-Server/3.6 Date: Thu, 16 May 2002 13:21:00 GMT Location: http://www.xyz.com/itc/sysaccsec/security/secser.html Content-type: text/html Content-length: 248 Found

Found

This document has moved to a new location. Please update your documents and hotlists accordingly. Of course I was baffled so I turned to network security folks and asked for some debugging advice... Well they instructed me to use TELNET and lo and behold $ TELNET www.reachme.com 80 GET www.reachme.com HTTP/1.0 ! And off we go! ... So I was a bit perturbed as to why fetch_http('s) output was being brandished in the proxy server... Was it the port ? Although . . . rem_port = 80; . . . Later in the fetch_http.c code the sockaddr structure is being set for the call to connect the socket remote.sa_family = hostinfo->h_addrtype; . . remote.sa_data[0] = rem_port >> 8; remote.sa_data[1] = (rem_port&255); . . . so ----------------------------------------------------- | |00 |80 | | | | | |~| | | | | | ----------------------------------------------------- ^ d0 d1 d2 ---------------------------> d14 | ^ ^ sa_family | | port | hostinfo->h_addr_list[0][j] Fair enuff! Was working ... now its not! The proxy server was not allowing the HTML script to be sent to me so following the original post by Christoph Gartmann (Danke for the example KERMIT script) I FTPed the appropriate version of KERMIT for VMS7.1 and all was well! (As suggest by some on this list.) >Christoph Gartmann >Hello, > >currently I am using C-Kermit 7.0.197 to retrieve HTML documents from within >DCL. Now I would like to do the same for binary files, e.g. a .GIF . But here >I don't succeed. I had a look at the new 8.0 version and noticed, that it >includes full HTTP support but in Unix only :-( Why? And is there really >no way to achieve a HTTP retrieve of a binary file. > >Here is a Kermit script to fetch a HTML ASCII file and save it as TEMP.TEMP : > >; This script will connect to a WWW server and request a single document. >; Call it like this: >; kermit this.file "=" "www.server.name" "remote/file.name" >; Note that the VMS global symbol CKERMIT_STATUS contains the exit status. >; Ch.G., 25.05.00 Searching through the archives, I noticed that several people had accomplished the same goal through TELNET/CREATE_SESSION which creates a psuedo terminal device TNAx:. I would appreciate if anyone has any example DCL code using open/read/write to the device which would since this would be done by native VMS layered products. No big deal - KERMIT works well! (As always there are many ways to skin VMS!) Brudder Andrusha