int hostip_len, hostname_len;
char * exclude_list;
+ /*
+ * Check the host name and IP against the hard-coded
+ * representations of `localhost'.
+ */
+ if (!cfg.even_proxy_localhost &&
+ (sk_hostname_is_local(hostname) || sk_address_is_local(addr)))
+ return 0; /* do not proxy */
+
/* we want a string representation of the IP address for comparisons */
sk_getaddr(addr, hostip, 64);
return sk_new(addr, port, privport, oobinline, nodelay, plug);
}
-Socket new_listener(int port, Plug plug, int local_host_only)
+Socket new_listener(char *srcaddr, int port, Plug plug, int local_host_only)
{
/* TODO: SOCKS (and potentially others) support inbound
* TODO: connections via the proxy. support them.
*/
- return sk_newlistener(port, plug, local_host_only);
+ return sk_newlistener(srcaddr, port, plug, local_host_only);
}
/* ----------------------------------------------------------------------