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.
This commit is contained in:
Robert James Kaes committed 2004-04-27 18:53:14 +00:00
1 parent 3b961ec66b
commit 18df4910a4
9 files changed
+93 -32

No files matched your search

+5 -4
View File
@@ -1,4 +1,4 @@
/* $Id: sock.h,v 1.12 2004-02-18 20:18:53 rjkaes Exp $
/* $Id: sock.h,v 1.13 2004-04-27 18:53:14 rjkaes Exp $
*
* See 'sock.c' for a detailed description.
*
@@ -20,17 +20,18 @@
#define TINYPROXY_SOCK_H
/* The IP length is set to 48, since IPv6 can be that long */
#define PEER_IP_LENGTH 48
#define PEER_STRING_LENGTH 1024
#define IP_LENGTH 48
#define HOSTNAME_LENGTH 1024
#define MAXLINE (1024 * 4)
extern int opensock(const char* host, int port);
extern int opensock(const char* host, int port, const char* bind_to);
extern int listen_sock(uint16_t port, socklen_t* addrlen);
extern int socket_nonblocking(int sock);
extern int socket_blocking(int sock);
extern int getsock_ip(int fd, char* ipaddr);
extern int getpeer_information(int fd, char* ipaddr, char* string_addr);
#endif