summaryrefslogtreecommitdiff
path: root/src/usr.bin/nc/scripts/webrelay
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr.bin/nc/scripts/webrelay')
-rw-r--r--src/usr.bin/nc/scripts/webrelay46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/usr.bin/nc/scripts/webrelay b/src/usr.bin/nc/scripts/webrelay
deleted file mode 100644
index a0aa9e2a97..0000000000
--- a/src/usr.bin/nc/scripts/webrelay
+++ /dev/null
@@ -1,46 +0,0 @@
1#! /bin/sh
2# $OpenBSD: webrelay,v 1.2 2001/01/29 01:58:13 niklas Exp $
3
4## web relay -- a degenerate version of webproxy, usable with browsers that
5## don't understand proxies. This just forwards connections to a given server.
6## No query logging, no access control [although you can add it to XNC for
7## your own run], and full-URL links will undoubtedly confuse the browser
8## if it can't reach the server directly. This was actually written before
9## the full proxy was, and it shows.
10## The arguments in this case are the destination server and optional port.
11## Please flame pinheads who use self-referential absolute links.
12
13# set these as you wish: proxy port...
14PORT=8000
15# any extra args to the listening "nc", for instance "-s inside-net-addr"
16XNC=''
17
18# functionality switch, which has to be done fast to start the next listener
19case "${1}${RDEST}" in
20 "")
21 echo needs hostname
22 exit 1
23 ;;
24esac
25
26case "${1}" in
27 "")
28# no args: fire off new relayer process NOW. Will hang around for 10 minutes
29 nc -w 600 -l -n -p $PORT -e "$0" $XNC < /dev/null > /dev/null 2>&1 &
30# and handle this request, which will simply fail if vars not set yet.
31 exec nc -w 15 $RDEST $RPORT
32 ;;
33esac
34
35# Fall here for setup; this can now be slower.
36RDEST="$1"
37RPORT="$2"
38test "$RPORT" || RPORT=80
39export RDEST RPORT
40
41# Launch the first relayer same as above, but let its error msgs show up
42# will hang around for a minute, and exit if no new connections arrive.
43nc -v -w 600 -l -p $PORT -e "$0" $XNC < /dev/null > /dev/null &
44echo \
45 "Relay to ${RDEST}:${RPORT} running -- point your browser here on port $PORT"
46exit 0