Thread server basteln: problem mit einfachserver (9 answers)
Opened by esskar at 2004-01-23 06:57

esskar
 2004-01-23 06:57
#36863 #36863
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl

$hostname = "localhost";

use IO::Socket;
$client_socket = new IO::Socket::INET (
PeerAddr => $hostname,
PeerPort => 13,
Proto => 'tcp')|| die "Kein Socket... $!\n";

print $client_socket "HTTP/1.0 /path/index.pl?param1=hallo\n";
print $client_socket "n\n";

$content = <$client_socket>;
$client_socket->close();
print "Content-Type: text/html\n\n";
print $content."\n";


ps: schau dir aber besser mal die Module:
Http::Daemon,
Http::Request
LWP::UserAgent
etcpp. an

außerdem könntest du dir mal wissen zum HTTP Protokol aneigenen!

View full thread server basteln: problem mit einfachserver