New. An interface for objects that want to act on every message passing
[platform/upstream/libsoup.git] / tests / get.c
index 6956652..5c7e5d0 100644 (file)
@@ -205,17 +205,27 @@ int
 main (int argc, char **argv)
 {
        const char *cafile = NULL;
+       SoupUri *proxy = NULL;
        int opt;
 
        g_type_init ();
        g_thread_init (NULL);
 
-       while ((opt = getopt (argc, argv, "c:r")) != -1) {
+       while ((opt = getopt (argc, argv, "c:p:r")) != -1) {
                switch (opt) {
                case 'c':
                        cafile = optarg;
                        break;
 
+               case 'p':
+                       proxy = soup_uri_new (optarg);
+                       if (!proxy) {
+                               fprintf (stderr, "Could not parse %s as URI\n",
+                                        optarg);
+                               exit (1);
+                       }
+                       break;
+
                case 'r':
                        recurse = TRUE;
                        break;
@@ -239,6 +249,7 @@ main (int argc, char **argv)
 
        session = soup_session_async_new_with_options (
                SOUP_SESSION_SSL_CA_FILE, cafile,
+               SOUP_SESSION_PROXY_URI, proxy,
                NULL);
 
        if (recurse) {