Article delegate-en/2217 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
search
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]

Newsgroups: mail-lists.delegate-en

[DeleGate-En] Is this a possible use for delegate?
23 Apr 2003 04:08:03 GMT testuser <pveeabdyi-t7hpjin2rwxr.ml@ml.delegate.org>


I've done it, using 'iptables --REDIRECT' in linux.

iptables -t nat -A PREROUTING -d 10.10.11.1 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT 
--to-ports 81

Then I wrote a short program that listened to port 81 (using xinetd)
and redirected them to the web server on port 80.  The program on port 
81 just reads (and parses) the input given, and returns the following:
----------
HTTP/1.1 302 Moved Temporarily
Location: http://10.10.11.1/index.cgi?url=%2f&host=&method=1
Cache-Control: no-cache
Expires: 0
Pragma: no-cache
Content-Type: text/html

<HTML>
<META HTTP-EQUIV="Expires" CONTENT="0">
<META HTTP-EQUIV="Refresh" 
CONTENT="0;URL=http://10.10.11.1/index.cgi?url=%2f&host=&method=2">
<BODY 
onload="document.location='http://10.10.11.1/index.cgi?url=%2f&host=&method=3'">
This is a redirecting page.<BR>
Please go <A HREF="//10.10.11.1/index.cgi?url=%2f&host=&method=4">here</A>
</BODY></HTML>
--

There are four different ways of redirecting a user, and I've used them 
all.  The script doesn't try to give a real web page because it's easier 
to let Apache do it.


  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
@_@V