]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Add a '-proxycmd' command-line option.
authorSimon Tatham <anakin@pobox.com>
Tue, 3 May 2016 13:31:10 +0000 (14:31 +0100)
committerSimon Tatham <anakin@pobox.com>
Tue, 3 May 2016 14:59:15 +0000 (15:59 +0100)
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.

cmdline.c
doc/using.but

index 92c87b3b797b61da4cd5a171699983377d10cc88..e6b69073a2e236a3121e9649d07657e42bacd2af 100644 (file)
--- 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 */
 }
 
index fc5859cf97b60269ac557959cb480f021da53d7d..8a4b95db23db9593141aabd5eb84802adf22b7aa 100644 (file)
@@ -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.