Commit a00c0f10 authored by Willi Rath's avatar Willi Rath

Add socks5 with chromium wrapper

parent 3df8927a
#!/bin/bash
# check inputs and print USAGE message
if [ $# -lt 1 ]; then
echo "USAGE: " $0 "<tunnel-host> [URL]"
echo "where <tunnel-host> can be of the form user@host."
echo ""
exit
fi
# read tunnel host and print info to screen
tunnel_host=$1
echo will route traffic through ${tunnel_host}
# read URL
URL=$2
# find free port
socks_5_port=`python -c 'import socket; s=socket.socket(); s.bind(("", 0)); print(s.getsockname()[1]); s.close()'`
echo using port $socks_5_port
# Open socks5 proxy which will close after 15 Seconds if the tunnel is not
# used. Extension of sleep time necessary?
ssh -f -D localhost:${socks_5_port} ${tunnel_host} sleep 15
browser=chromium-browser
which chromium-browser || browser=chromium
${browser} --new-window --user-data-dir="/tmp/chromium_user_data_$(date -Ins)" --proxy-server="socks5://localhost:${socks_5_port}" ${URL}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment