summaryrefslogtreecommitdiff
path: root/httpconnectd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'httpconnectd.sh')
-rw-r--r--httpconnectd.sh35
1 files changed, 0 insertions, 35 deletions
diff --git a/httpconnectd.sh b/httpconnectd.sh
deleted file mode 100644
index 24edb68..0000000
--- a/httpconnectd.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2016 Luke Shumaker
-# License: WTFPLv2
-
-# Dependencies:
-# - bash
-# - socat
-# - date -R
-
-server='httpconnectd'
-
-MethodNotAllowed() {
- printf '%s\r\n' \
- 'HTTP/1.1 405 Method Not Allowed' \
- "Server: $server" \
- "Date: $(date -R)" \
- 'Allow: CONNECT' \
- ''
- exit 0
-}
-
-worker() {
- read -r method dest version
- if [[ "$method" != CONNECT ]]; then
- MethodNotAllowed
- fi
- while read -r line; do
- if [[ "$line" == $'\r' ]]; then
- break;
- fi
- done
- exec socat STDIO TCP-CONNECT:"$dest"
-}
-
-worker "$@"