From owner-freebsd-questions Fri Sep 13 08:52:29 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id IAA28839 for questions-outgoing; Fri, 13 Sep 1996 08:52:29 -0700 (PDT) Received: from mail.calweb.com (mail.calweb.com [165.90.138.20]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id IAA28832 for ; Fri, 13 Sep 1996 08:52:21 -0700 (PDT) Received: from devnull.calweb.com (devnull.calweb.com [165.90.138.92]) by mail.calweb.com (8.7.5/8.7.3) with SMTP id IAA23191; Fri, 13 Sep 1996 08:42:29 -0700 (PDT) Date: Fri, 13 Sep 1996 08:48:02 -0700 () From: Jason Fesler To: Adam David cc: Nadav Eiron , ke6mgb@ix.NETcom.COM, questions@FreeBSD.org Subject: Re: ampr.org In-Reply-To: <199609131238.MAA01137@veda.is> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk My solution is attached below. This was never meant to be publicized, so any critiques of it can go to /dev/null - I'm not interested :-). However, if you can use it, awesome. I use it both on the non-webserver machines, as well as on my home 28k link to pass the connections back to the T1 side. Standard disclaimers, if it formats your hard drive, let me know so I can stop using it too :-). I used a combination of perl, and tcp_wrappers to determine which address to redirect to (multiple IP addresses on that box). One can probably not bother if they only have a single IP address, and work strictly out of inetd .. /etc/hosts.allow for tcp_wrappers extended mode fakehtml@165.90.138.208: all : twist /usr/libexec/fakehtml http\://165.90.189.182 fakehtml : all : twist /usr/libexec/fakehtml http\://www.calweb.com/ #!/usr/local/bin/perl5 select(STDOUT); $|=1; $date=`date`; chop $date; $base=$ARGV[0]; if ($base eq "") {$base = "http://www.gigo.com/";} unless ($base =~ /.*\/$/) {$base = $base . "/";} $l=; $l =~ s/\n$//; #chop $l =~ s/\r$//; #chop if ($l =~ /.*\/cgi-bin\/.*/) { $base =~ s/~.*//; # in the case of /cgi-bin/, remove #~username from the redirected URL, #since users do not have personal CGI #directories } $l =~ s/[ \t]+/ /g; # extra spaces # print "incoming is $l\n"; @words=split(" ",$l); if (substr($words[1],0,1) eq "/") { $words[1] = substr($words[1],1,1000); } File fakehtml not changed so no update needed. {root@web2;0.47:/usr/libexec} cat fakehtml #!/usr/local/bin/perl5 select(STDOUT); $|=1; $date=`date`; chop $date; $base=$ARGV[0]; if ($base eq "") {$base = "http://www.gigo.com/";} unless ($base =~ /.*\/$/) {$base = $base . "/";} $l=; $l =~ s/\n$//; #chop $l =~ s/\r$//; #chop if ($l =~ /.*\/cgi-bin\/.*/) { $base =~ s/~.*//; } $l =~ s/[ \t]+/ /g; # extra spaces # print "incoming is $l\n"; @words=split(" ",$l); if (substr($words[1],0,1) eq "/") { $words[1] = substr($words[1],1,1000); } $a="${base}$words[1]"; print <Document moved

Document moved

The document has moved here .

EOF ; On Fri, 13 Sep 1996, Adam David wrote: > > > >I am currently registered under ampr.org - I am ke6mgb.ampr.org. I was > > > >wondering how I can have it, so when someone connects to ke6mgb.ampr.org, it > > > >will automatically route them to another ip or www page? > > > >Thank You, > > > >Rod > > > >KE6MGB - HAM RADIO OPERATOR - IP: 44.16.1.219 <--> KE6MGB.AMPR.ORG > > > > > > If I understood your question right, you need a minimal server program to > > > accept connections on specific port numbers and hand off the connection to > > > another host:port destination. > > > There is something that does just that! It's part of the TIS fwtk > > (firewall toolikit) and is called plug-gw. It's a tiny little program you > > run from inetd.conf and that redirects connections to specific ports on > > the current host to other addresses (host:ports). It is driven by a > > configuration file where you can specify the host/port to connect to > > based on the origin of the connection. Very nice stuff, and amazingly > > compact (like the rest of the TIS fwtk). > > plug-gw will pass all traffic on the connection through the forwarding host, > which might not be what was meant. What I mean by redirect is to transfer > the connection early on, so that further traffic on the connection will not > necessarily travel via that first host. > > Adam David > -- Jason Fesler jfesler@calweb.com Internic info: 'whois jf319' Admin, CalWeb Internet Service Support: 916-641-9320 http://calweb.com Unsolicited propoganda delivered electronicly shall be returned in bulk! Junk mail problems? 'man procmail' (unix) or 'buy eudora pro' (windows)