diff options
author | brian <brian@FreeBSD.org> | 2000-03-21 01:18:06 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2000-03-21 01:18:06 +0000 |
commit | b8b5509db759bc5a0e419f5965c6de545e4233bf (patch) | |
tree | 143a02e85706553d233e22666590f23c0c528cc0 /www/httptunnel/files | |
parent | 2f7ff34b7d7b0cb1c4956721e768c9119a2f6054 (diff) | |
download | FreeBSD-ports-b8b5509db759bc5a0e419f5965c6de545e4233bf.zip FreeBSD-ports-b8b5509db759bc5a0e419f5965c6de545e4233bf.tar.gz |
An implementation of TCP/IP over HTTP with local modifications to allow
binding the server to a single IP number.
Diffstat (limited to 'www/httptunnel/files')
-rw-r--r-- | www/httptunnel/files/httptunnel.sh | 36 | ||||
-rw-r--r-- | www/httptunnel/files/patch-aa | 48 | ||||
-rw-r--r-- | www/httptunnel/files/patch-ab | 11 | ||||
-rw-r--r-- | www/httptunnel/files/patch-ac | 14 |
4 files changed, 109 insertions, 0 deletions
diff --git a/www/httptunnel/files/httptunnel.sh b/www/httptunnel/files/httptunnel.sh new file mode 100644 index 0000000..153c3fa --- /dev/null +++ b/www/httptunnel/files/httptunnel.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# +# $FreeBSD$ + +HTSPORT= # [host:]port to listen for htc connection +HTSFORWARD= # Talk to this socket +HTSDEVICE= # *or* talk to this device + +HTCPORT= # host:port where hts is running +HTCFORWARD= # Talk to this socket +HTCDEVICE= # *or* talk to this device + +HTCPROXY= # host:port of proxy to talk to hts via +HTCPROXYAUTH= # user:password to pass to proxy +HTCPROXYBUFFER=1K # Buffer size for buffered proxies +HTCBROWSER='Mozilla/4.7 [en] (X11; I; Linux 2.2.12 i386)' # Pretend to be this +HTCARGS=-S # Any other arguments required + +if [ -n "$HTSPORT" -a -x /usr/local/bin/hts ]; then + [ -n "$HTSFORWARD" ] && args="-F $HTSFORWARD" + [ -n "$HTSDEVICE" ] && args="-d $HTSDEVICE" + /usr/local/bin/hts $args $HTSPORT && echo -n ' hts' +fi + +if [ -n "$HTCPORT" -a -x /usr/local/bin/htc ]; then + set -- + [ -n "$HTCFORWARD" ] && set -- -F $HTCFORWARD + [ -n "$HTCDEVICE" ] && set -- -d $HTCDEVICE + [ -n "$HTCBROWSER" ] && set -- -U "$HTCBROWSER" "$@" + if [ -n "$HTCPROXY" ]; then + [ -n "$HTCPROXYBUFFER" ] && set -- -B $HTCPROXYBUFFER "$@" + [ -n "$HTCPROXYAUTH" ] && set -- -A $HTCPROXYAUTH "$@" + set -- -P $HTCPROXY "$@" + fi + /usr/local/bin/htc "$@" $HTCARGS $HTCPORT && echo -n ' htc' +fi diff --git a/www/httptunnel/files/patch-aa b/www/httptunnel/files/patch-aa new file mode 100644 index 0000000..43c47a9 --- /dev/null +++ b/www/httptunnel/files/patch-aa @@ -0,0 +1,48 @@ +--- common.c.orig Wed Dec 15 06:39:03 1999 ++++ common.c Thu Mar 16 02:48:06 2000 +@@ -115,7 +115,7 @@ + #endif + + int +-server_socket (int port, int backlog) ++server_socket (struct in_addr addr, int port, int backlog) + { + struct sockaddr_in address; + int i, s; +@@ -131,10 +131,12 @@ + strerror (errno)); + } + ++ memset(&address, '\0', sizeof address); ++ address.sin_len = sizeof address; + address.sin_family = PF_INET; + address.sin_port = htons ((short)port); +- address.sin_addr.s_addr = INADDR_ANY; +- ++ address.sin_addr = addr; ++ + if (bind (s, (struct sockaddr *)&address, sizeof (address)) == -1) + { + close (s); +@@ -153,8 +155,10 @@ + int + set_address (struct sockaddr_in *address, const char *host, int port) + { +- address->sin_family = PF_INET; +- address->sin_port = htons ((short)port); ++ memset(address, '\0', sizeof *address); ++ address->sin_len = sizeof *address; ++ address->sin_family = AF_INET; ++ address->sin_port = htons((u_short)port); + address->sin_addr.s_addr = inet_addr (host); + + if (address->sin_addr.s_addr == INADDR_NONE) +@@ -334,7 +338,7 @@ + p = strchr (*name, ':'); + if (p != NULL) + { +- *port = atoi (p + 1); ++ *port = atoi(p + 1); + *p = '\0'; + } + } diff --git a/www/httptunnel/files/patch-ab b/www/httptunnel/files/patch-ab new file mode 100644 index 0000000..1dc1360 --- /dev/null +++ b/www/httptunnel/files/patch-ab @@ -0,0 +1,11 @@ +--- common.h.orig Thu Mar 16 00:41:09 2000 ++++ common.h Thu Mar 16 00:42:56 2000 +@@ -58,7 +58,7 @@ + static inline void log_annoying () {} + #endif + +-extern int server_socket (int port, int backlog); ++extern int server_socket (struct in_addr addr, int port, int backlog); + extern int set_address (struct sockaddr_in *address, + const char *host, int port); + extern int open_device (char *device); diff --git a/www/httptunnel/files/patch-ac b/www/httptunnel/files/patch-ac new file mode 100644 index 0000000..d0c5db9 --- /dev/null +++ b/www/httptunnel/files/patch-ac @@ -0,0 +1,14 @@ +--- htc.c.orig Thu Mar 16 00:27:51 2000 ++++ htc.c Thu Mar 16 00:43:21 2000 +@@ -408,7 +408,10 @@ + + if (arg.forward_port != -1) + { +- s = server_socket (arg.forward_port, 0); ++ struct in_addr addr; ++ ++ addr.s_addr = INADDR_ANY; ++ s = server_socket (addr, arg.forward_port, 0); + log_debug ("server_socket (%d) = %d", arg.forward_port, s); + if (s == -1) + { |