From: Simon Tatham Date: Tue, 3 May 2016 13:31:10 +0000 (+0100) Subject: Add a '-proxycmd' command-line option. X-Git-Tag: 0.68~142 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=e65e5d165fc2935fcc4bece20dddce485316042f;p=PuTTY.git Add a '-proxycmd' command-line option. This is equivalent to selecting 'Local' as the proxy type and entering the argument string in the proxy command box, in the GUI. I've pulled this out of all the other proxy options to promote to a named command-line option, partly because it's the proxy option with the most natural command-line expression in the first place (any shell command you might want to use is already in the form of a single string), and also because it has uses beyond end-user proxying applications: in particular, replacing the network connection with a local process is a convenient way to do testing in the style of contrib/samplekex.py, avoiding the need to run a separate command to make the test 'server' listen on a port. --- diff --git a/cmdline.c b/cmdline.c index 92c87b3b..e6b69073 100644 --- a/cmdline.c +++ b/cmdline.c @@ -601,6 +601,14 @@ int cmdline_process_param(const char *p, char *value, filename_free(fn); } + if (!strcmp(p, "-proxycmd")) { + RETURN(2); + UNAVAILABLE_IN(TOOLTYPE_NONNETWORK); + SAVEABLE(0); + conf_set_int(conf, CONF_proxy_type, PROXY_CMD); + conf_set_str(conf, CONF_proxy_telnet_command, value); + } + return ret; /* unrecognised */ } diff --git a/doc/using.but b/doc/using.but index fc5859cf..8a4b95db 100644 --- a/doc/using.but +++ b/doc/using.but @@ -1000,3 +1000,13 @@ different logging modes, all available from the GUI too: \b \c{-sshrawlog} selects \q{SSH packets and raw data} logging mode. For more information on logging configuration, see \k{config-logging}. + +\S2{using-cmdline-proxycmd} \i\c{-proxycmd}: specify a local proxy +command + +This option enables PuTTY's mode for running a \I{Local proxy}command +on the local machine and using it as a proxy for the network +connection. It expects a shell command string as an argument. + +See \k{config-proxy-type} for more information on this, and on other +proxy settings.