From 18df4910a43e8f1b0d9d10df37236fabf0ba8508 Mon Sep 17 00:00:00 2001 From: Robert James Kaes Date: Tue, 27 Apr 2004 18:53:14 +0000 Subject: Added the "BindSame" configure directive from Oswald Buddenhagen. This allows tinyproxy to respond to a request bound to the same interface that the request came in on. As Oswald explains: "attached is a patch that adds the BindSame option. it causes binding an outgoing connection to the ip address of the respective incoming connection. that way one can simulate an entire proxy farm with a single instance of tinyproxy on a multi-homed machine." Cool. --- src/grammar.y | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/grammar.y') diff --git a/src/grammar.y b/src/grammar.y index 9f3a74c..72d51b8 100644 --- a/src/grammar.y +++ b/src/grammar.y @@ -1,4 +1,4 @@ -/* $Id: grammar.y,v 1.24 2004-01-26 19:11:51 rjkaes Exp $ +/* $Id: grammar.y,v 1.25 2004-04-27 18:53:14 rjkaes Exp $ * * This is the grammar for tinyproxy's configuration file. It needs to be * in sync with scanner.l. If you know more about yacc and lex than I do @@ -51,7 +51,7 @@ int yylex(void); %token KW_FILTER_CASESENSITIVE %token KW_UPSTREAM %token KW_REVERSEPATH KW_REVERSEONLY KW_REVERSEMAGIC KW_REVERSEBASEURL -%token KW_CONNECTPORT KW_BIND +%token KW_CONNECTPORT KW_BIND KW_BINDSAME %token KW_STATHOST %token KW_ALLOW KW_DENY %token KW_ERRORPAGE KW_DEFAULT_ERRORPAGE @@ -250,6 +250,11 @@ statement log_message(LOG_WARNING, "The 'Bind' directive can not be used with transparent proxy support. Ignoring the directive."); #endif } + | KW_BINDSAME yesno + { + log_message(LOG_INFO, "Binding outgoing connections to incoming IP"); + config.bindsame = $2; + } | KW_VIA_PROXY_NAME string { log_message(LOG_INFO, "Setting \"Via\" proxy name to: %s", $2); -- cgit v1.2.3