Purpose
One of my projects required socat/daemontools-based proxies. This script aims to make these little one-off proxies easier to deal with. The project started with just a few proxies, but quickly grew into requests for many. Scripting was my way of helping to ensure they were all setup correctly and that I didn't fudge one by mistake. The script was created for this one particular project, and may never be used again - but I have already found it to be well worth the time spent.
Prerequisites
- socat
- daemontools
- FreeBSD :)
Usage
Usage: ./proxyadm.sh <-c create> <-d DESTHOST> <-p DESTPORT> [-l LOCALPORT] [-n PROXYNAME] [-s]
Usage: ./proxyadm.sh <-c delete> <-n PROXYNAME>
Usage: ./proxyadm.sh <-c list>
Usage: ./proxyadm.sh <-h> (this help screen)
- The reason for the DESTHOST and DESTPORT requirements should be obvious.
- LOCALPORT can be specified, but if not (or if the specified number is already used or does not fall in the range of 1025:65535) it is randomly generated.
- PROXYNAME can be specified as well, but is otherwise automatically generated using DESTHOST.
- My intention is for SSL proxies (-s) to be possible in the near future