summaryrefslogtreecommitdiffhomepage
path: root/src/upstream.h
diff options
context:
space:
mode:
authorGonzalo Tornaria <tornaria@math.utexas.edu>2016-12-20 21:30:43 +0000
committerrofl0r <rofl0r@users.noreply.github.com>2018-02-06 16:11:39 +0000
commit8906b0734e5c61016d9d4090507f010b2006292d (patch)
tree73eea974f5a292516e1ffd85ed44ddeae1b34764 /src/upstream.h
parent116e59e93346ddbe08f56f8c7e8bd648690c0242 (diff)
add SOCKS upstream proxy support (socks4/socks5)
original patch submitted in 2006 to debian mailing list: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=392848%29#12 this version was rebased to git and updated by Russ Dill <russ.dill@gmail.com> in 2015 (the original patch used a different config file format). as discussed in #40. commit message by @rofl0r.
Diffstat (limited to 'src/upstream.h')
-rw-r--r--src/upstream.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/upstream.h b/src/upstream.h
index 34dad68..7855214 100644
--- a/src/upstream.h
+++ b/src/upstream.h
@@ -31,17 +31,20 @@
* Even if upstream support is not compiled into tinyproxy, this
* structure still needs to be defined.
*/
+typedef enum {HTTP_TYPE, SOCKS4_TYPE, SOCKS5_TYPE} proxy_type;
struct upstream {
struct upstream *next;
char *domain; /* optional */
char *host;
int port;
in_addr_t ip, mask;
+ proxy_type type;
};
#ifdef UPSTREAM_SUPPORT
+const char *proxy_type_name(proxy_type type);
extern void upstream_add (const char *host, int port, const char *domain,
- struct upstream **upstream_list);
+ proxy_type type, struct upstream **upstream_list);
extern struct upstream *upstream_get (char *host, struct upstream *up);
extern void free_upstream_list (struct upstream *up);
#endif /* UPSTREAM_SUPPORT */