ctrl_settitle(b, "Connection/Proxy",
"Options controlling proxy usage");
- s = ctrl_getset(b, "Connection/Proxy", "basics", "Proxy basics");
- ctrl_radiobuttons(s, "Proxy type:", 't', 4,
+ s = ctrl_getset(b, "Connection/Proxy", "basics", NULL);
+ ctrl_radiobuttons(s, "Proxy type:", 't', 3,
HELPCTX(proxy_type),
dlg_stdradiobutton_handler,
I(offsetof(Config, proxy_type)),
"None", I(PROXY_NONE),
+ "SOCKS 4", I(PROXY_SOCKS4),
+ "SOCKS 5", I(PROXY_SOCKS5),
"HTTP", I(PROXY_HTTP),
- "SOCKS", I(PROXY_SOCKS),
"Telnet", I(PROXY_TELNET),
NULL);
ctrl_columns(s, 2, 80, 20);
I(offsetof(Config,proxy_password)),
I(sizeof(((Config *)0)->proxy_password)));
c->editbox.password = 1;
-
- s = ctrl_getset(b, "Connection/Proxy", "misc",
- "Miscellaneous proxy settings");
ctrl_editbox(s, "Telnet command", 'm', 100,
HELPCTX(proxy_command),
dlg_stdeditbox_handler,
I(offsetof(Config,proxy_telnet_command)),
I(sizeof(((Config *)0)->proxy_telnet_command)));
- ctrl_radiobuttons(s, "SOCKS Version", 'v', 2,
- HELPCTX(proxy_socksver),
- dlg_stdradiobutton_handler,
- I(offsetof(Config, proxy_socks_version)),
- "Version 5", I(5), "Version 4", I(4), NULL);
}
/*
-\versionid $Id: config.but,v 1.63 2003/04/26 13:22:25 simon Exp $
+\versionid $Id: config.but,v 1.64 2003/05/07 12:07:23 simon Exp $
\C{config} Configuring PuTTY
web server supporting the HTTP \cw{CONNECT} command, as documented
in \W{http://www.ietf.org/rfc/rfc2817.txt}{RFC 2817}.
-\b Selecting \q{SOCKS} allows you to proxy your connections through
-a SOCKS server.
+\b Selecting \q{SOCKS 4} or \q{SOCKS 5} allows you to proxy your
+connections through a SOCKS server.
\b Many firewalls implement a less formal type of proxy in which a
user can make a Telnet connection directly to the firewall machine
tokens in the Telnet command, then the \q{Username} and \q{Password}
configuration fields will be ignored.
-\S{config-proxy-socksver} Selecting the version of the SOCKS protocol
-
-\cfg{winhelp-topic}{proxy.socksver}
-
-SOCKS servers exist in two versions: version 5
-(\W{http://www.ietf.org/rfc/rfc1928.txt}{RFC 1928}) and the earlier
-version 4. The \q{SOCKS Version} radio buttons allow you to select
-which one to use, if you have selected the SOCKS proxy type.
-
\H{config-telnet} The Telnet panel
The Telnet panel allows you to configure options that only apply to
#define do_proxy_dns(cfg) \
(cfg->proxy_dns == FORCE_ON || \
- (cfg->proxy_dns == AUTO && cfg->proxy_type != PROXY_SOCKS))
+ (cfg->proxy_dns == AUTO && \
+ cfg->proxy_type != PROXY_SOCKS4 && \
+ cfg->proxy_type != PROXY_SOCKS5))
/*
* Call this when proxy negotiation is complete, so that this
if (cfg->proxy_type == PROXY_HTTP) {
ret->negotiate = proxy_http_negotiate;
- } else if (cfg->proxy_type == PROXY_SOCKS) {
- if (cfg->proxy_socks_version == 4)
- ret->negotiate = proxy_socks4_negotiate;
- else
- ret->negotiate = proxy_socks5_negotiate;
+ } else if (cfg->proxy_type == PROXY_SOCKS4) {
+ ret->negotiate = proxy_socks4_negotiate;
+ } else if (cfg->proxy_type == PROXY_SOCKS5) {
+ ret->negotiate = proxy_socks5_negotiate;
} else if (cfg->proxy_type == PROXY_TELNET) {
ret->negotiate = proxy_telnet_negotiate;
} else {
/*
* Proxy types.
*/
- PROXY_NONE, PROXY_HTTP, PROXY_SOCKS, PROXY_TELNET, PROXY_CMD
+ PROXY_NONE, PROXY_SOCKS4, PROXY_SOCKS5,
+ PROXY_HTTP, PROXY_TELNET, PROXY_CMD
};
enum {
char proxy_username[32];
char proxy_password[32];
char proxy_telnet_command[512];
- int proxy_socks_version;
/* SSH options */
char remote_cmd[512];
char remote_cmd2[512]; /* fallback if the first fails
write_setting_s(sesskey, "ProxyExcludeList", cfg->proxy_exclude_list);
write_setting_i(sesskey, "ProxyDNS", (cfg->proxy_dns+2)%3);
write_setting_i(sesskey, "ProxyLocalhost", cfg->even_proxy_localhost);
- write_setting_i(sesskey, "ProxyType", cfg->proxy_type);
+ write_setting_i(sesskey, "ProxyMethod", cfg->proxy_type);
write_setting_s(sesskey, "ProxyHost", cfg->proxy_host);
write_setting_i(sesskey, "ProxyPort", cfg->proxy_port);
write_setting_s(sesskey, "ProxyUsername", cfg->proxy_username);
write_setting_s(sesskey, "ProxyPassword", cfg->proxy_password);
write_setting_s(sesskey, "ProxyTelnetCommand", cfg->proxy_telnet_command);
- write_setting_i(sesskey, "ProxySOCKSVersion", cfg->proxy_socks_version);
{
char buf[2 * sizeof(cfg->environmt)], *p, *q;
sizeof(cfg->proxy_exclude_list));
gppi(sesskey, "ProxyDNS", 1, &i); cfg->proxy_dns = (i+1)%3;
gppi(sesskey, "ProxyLocalhost", 0, &cfg->even_proxy_localhost);
- gppi(sesskey, "ProxyType", PROXY_NONE, &cfg->proxy_type);
+ gppi(sesskey, "ProxyMethod", -1, &cfg->proxy_type);
+ if (cfg->proxy_type == -1) {
+ int i;
+ gppi(sesskey, "ProxyType", -1, &i);
+ if (i == 0)
+ cfg->proxy_type = PROXY_NONE;
+ else if (i == 1)
+ cfg->proxy_type = PROXY_HTTP;
+ else if (i == 3)
+ cfg->proxy_type = PROXY_TELNET;
+ else if (i == 4)
+ cfg->proxy_type = PROXY_CMD;
+ else {
+ gppi(sesskey, "ProxySOCKSVersion", 5, &i);
+ if (i == 5)
+ cfg->proxy_type = PROXY_SOCKS5;
+ else
+ cfg->proxy_type = PROXY_SOCKS4;
+ }
+ }
gpps(sesskey, "ProxyHost", "proxy", cfg->proxy_host,
sizeof(cfg->proxy_host));
gppi(sesskey, "ProxyPort", 80, &cfg->proxy_port);
sizeof(cfg->proxy_password));
gpps(sesskey, "ProxyTelnetCommand", "connect %host %port\\n",
cfg->proxy_telnet_command, sizeof(cfg->proxy_telnet_command));
- gppi(sesskey, "ProxySOCKSVersion", 5, &cfg->proxy_socks_version);
{
char buf[2 * sizeof(cfg->environmt)], *p, *q;
* Unix supports a local-command proxy. This also means we must
* adjust the text on the `Telnet command' control.
*/
- s = ctrl_getset(b, "Connection/Proxy", "basics", "Proxy basics");
+ s = ctrl_getset(b, "Connection/Proxy", "basics", NULL);
{
int i;
for (i = 0; i < s->ncontrols; i++) {
c->generic.context.i == offsetof(Config, proxy_type)) {
assert(c->generic.handler == dlg_stdradiobutton_handler);
c->radio.nbuttons++;
- c->radio.ncolumns++;
c->radio.buttons =
sresize(c->radio.buttons, c->radio.nbuttons, char *);
c->radio.buttons[c->radio.nbuttons-1] =
break;
}
}
- }
- s = ctrl_getset(b, "Connection/Proxy", "misc",
- "Miscellaneous proxy settings");
- {
- int i;
+
for (i = 0; i < s->ncontrols; i++) {
c = s->ctrls[i];
if (c->generic.type == CTRL_EDITBOX &&