Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTTP programming - need help with TCP IP and streaming

Status
Not open for further replies.

ksoong

Programmer
Oct 3, 2000
57
CA
I want to write a program, either in Perl or C that will connect to an HTTP server, at port 80, and be able to request from that server an HTML, ASP or CGI page, and receive from the server the streamed HTML in text format. How can this be done? Please be detailed, or if you can, please point me to references on the net that answer my question. [sig][/sig]
 
Perl's not a bad choice for that, have a look on CPAN (start at
Have you heard of the CGI module btw? [sig]<p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>Making mistakes, so you don't have to. &lt;grin&gt;[/sig]
 
no... I haven't heard of btw.

is there any where on the net that has some sample programs or anything? [sig][/sig]
 
The CGI module is available on CPAN and comes with some reasonable documentation. [sig]<p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>Making mistakes, so you don't have to. &lt;grin&gt;[/sig]
 
I have been working on some perl code to do this and then do some replacements. Here is the relevant perl code if you are interested (it is probably not great)

[tt]#!/usr/local/bin/perl

use CGI qw/:standard :netscape/; # don't think this line is neccesary
require &quot;/u/httpd/cgi-bin/cgi-lib.pl&quot;; # don't think this line is neccesary
$url = 'use LWP::Simple;
$content = get(&quot;$url&quot;);

print &quot;Content-type: text/html\n\n&quot;;
print $content;[/tt]

If anyone has any ideas on this or
which is a related topic I would love to know :) [sig]<p>fortytwo<br><a href=mailto:will@hellacool.co.uk>will@hellacool.co.uk</a><br><a href= test site</a><br> [/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top