Re: setting a http proxy in libsoup
- From: haithem rahmani <haithem rahmani gmail com>
- To: libsoup-list gnome org
- Subject: Re: setting a http proxy in libsoup
- Date: Tue, 19 May 2009 17:25:51 +0100
Hi,
I rewrote my own test as following,
please take a look to the code:
int
main (int argc, char **argv)
{
SoupURI *proxy = NULL;
SoupSession *session;
SoupBuffer *b;
SoupMessage *msg;
g_thread_init (NULL);
g_type_init ();
session = soup_session_sync_new();
if (proxy)
{
g_object_set (G_OBJECT (session),
SOUP_SESSION_PROXY_URI, proxy,
NULL);
}
else
printf(" proxy NULL \n");
/*
* this message works fine since the site is local
* msg = soup_message_new(SOUP_METHOD_GET,
*/
/* this one does not work */
msg = soup_message_new(SOUP_METHOD_GET,
soup_session_send_message (session, msg);
b = soup_message_body_flatten(msg->response_body);
printf(" response_body : %s\n\n\n\n\n", b->data);
printf("proxy settings: username = %s \n
password = %s \n
host = %s \n
port %d\n",
proxy->user,
proxy->password,
proxy->host,
proxy->port);
return 0;
}
any comments please?
On Fri, May 15, 2009 at 6:55 AM, haithem rahmani
<haithem rahmani gmail com> wrote:
Hi all,
Sorry I my question was already discussed.
I'm trying to learn how to use libsoup,
I'm using the version 2.26.0
I compiled the get.c test but when runing it as follows:
/: 2 Cannot resolve hostname
so I wrote my own test to check that the proxy is correclty set
please find attached the test source code.
the test output is:
request_body :
response_body :
proxy settings: username = (null)
password = (null)
host = (null)
port 0
when changing the URL to a local one ,i.e does not need the proxy server I got the response_body filled with the target page content.
could you help me please.
regards.
haithem.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]