diff --git a/src/core/Makefile.am b/src/core/Makefile.am index ce4b4bb6..c664739b 100644 --- a/src/core/Makefile.am +++ b/src/core/Makefile.am @@ -33,6 +33,12 @@ libcore_a_SOURCES = \ network-openssl.c \ network-proxy.c \ network-proxy.h \ + network-proxy-simple.c \ + network-proxy-simple.h \ + network-proxy-http.c \ + network-proxy-http.h \ + network-proxy-socks5.c \ + network-proxy-socks5.h \ network-proxy-priv.h \ nicklist.c \ nickmatch-cache.c \ diff --git a/src/core/network-proxy.c b/src/core/network-proxy.c new file mode 100644 index 00000000..f056da6b --- /dev/null +++ b/src/core/network-proxy.c @@ -0,0 +1,43 @@ +/* + network-proxy.c : irssi + + Copyright (C) 2008 Enrico Scholz + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 and/or 3 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "module.h" + +#include "network-proxy.h" +#include +#include "network-proxy-simple.h" +#include "network-proxy-http.h" +#include "network-proxy-socks5.h" + +struct network_proxy *network_proxy_create(const char *type) +{ + if (type==NULL) + return NULL; + + if (strcmp(type, "simple")==0 || type[0]=='\0') + return network_proxy_simple_create(); + + if (strcmp(type, "http")==0) + return network_proxy_http_create(); + + if (strcmp(type, "socks5")==0) + return network_proxy_socks5_create(); + + g_error("unsupported proxy type '%s'", type); + return NULL; +}