tImplement proxy functionality as desired - ratox - FIFO based tox client
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 384067fc69a35126f6418ba219cadc925223c9b8
 (DIR) parent ce3ae41642d1b1cdb72060b1036d0c6c7e6bed96
 (HTM) Author: FRIGN <dev@frign.de>
       Date:   Tue,  6 Jan 2015 22:38:12 +0100
       
       Implement proxy functionality as desired
       
       Now we support both HTTP and SOCKS5 proxies. While at it, get rid
       of the outdated usage string and just establish the fact we have
       a bloody manpage for explanations.
       
       Diffstat:
         M config.def.h                        |       1 +
         M ratox.1                             |       2 +-
         M ratox.c                             |      10 ++--------
       
       3 files changed, 4 insertions(+), 9 deletions(-)
       ---
 (DIR) diff --git a/config.def.h b/config.def.h
       t@@ -15,6 +15,7 @@ static int   encryptsavefile = 0;
        static int      ipv6        = 0;
        static int      tcp         = 0;
        static int      proxy       = 0;
       +static int      proxytype   = 2; /* 1 = HTTP, 2 = SOCKS5 */
        static char     proxyaddr[] = "localhost";
        static uint16_t proxyport   = 8080;
        
 (DIR) diff --git a/ratox.1 b/ratox.1
       t@@ -25,7 +25,7 @@ Enable/Disable save file encryption.
        Enable/Disable TCP mode. Avoiding UDP in tox implies certain security
        considerations.
        .It Fl P p
       -Enable/Disable TCP SOCKS5 proxy as specified in \fIconfig.h\fR.
       +Enable/Disable TCP HTTP/SOCKS5 proxy as specified in \fIconfig.h\fR.
        .It Ar savefile
        Path of the file to load a profile from or create a new one in.
        .El
 (DIR) diff --git a/ratox.c b/ratox.c
       t@@ -1191,7 +1191,7 @@ toxinit(void)
                        snprintf(toxopt.proxy_address, sizeof(toxopt.proxy_address),
                                 "%s", proxyaddr);
                        toxopt.proxy_port = proxyport;
       -                toxopt.proxy_type = 1;
       +                toxopt.proxy_type = proxytype;
                        logmsg("Net > Using proxy %s:%hu\n", proxyaddr, proxyport);
                }
        
       t@@ -1943,13 +1943,7 @@ shutdown(void)
        static void
        usage(void)
        {
       -        eprintf("usage: %s [-4|-6] [-E|-e] [-tp] [savefile]\n"
       -                " -4\tIPv4 only\n"
       -                " -6\tIPv6 only\n"
       -                " -E\tEnable save file encryption\n"
       -                " -e\tDisable save file encryption\n"
       -                " -t\tEnable TCP mode (UDP by default)\n"
       -                " -p\tEnable TCP socks5 proxy\n", argv0);
       +        eprintf("usage: %s [-4|-6] [-E|-e] [-T|-t] [-P|-p] [savefile]\n", argv0);
        }
        
        int