Hi,
I have a very small piece of code as below. But I am not able to test it
because I am behind a proxy. How to add a proxy support.
- Thanks
nsCOMPtr<nsIServiceManager> servMan;
NS_InitXPCOM2(getter_AddRefs(servMan), nsnull, nsnull);
nsCOMPtr<nsIComponentRegistrar> registrar =
do_QueryInterface(servMan);
NS_ASSERTION(registrar, "Null nsIComponentRegistrar");
if (registrar) registrar->AutoRegister(nsnull);
nsCOMPtr<nsIURI> uri;
nsCOMPtr<nsIChannel> chan;
nsIProxyInfo* proxyInfo;
nsCAutoString scheme("http");
nsCAutoString proxy_host("172.16.42.133");
NS_NewProxyInfo(scheme, proxy_host, 8080, 0, &proxyInfo); //how to
set this new proxy in channel?
rv = NS_NewURI(getter_AddRefs(uri), "http://209.85.171.100");
RETURN_IF_FAILED(rv, "NS_NewURI");
rv = NS_NewChannel(getter_AddRefs(chan), uri, nsnull,
nsnull,nsnull);
RETURN_IF_FAILED(rv, "NS_OpenURI");
nsIInputStream* outparam;
rv = chan->Open(&outparam);
print_received_data(outparam);
_______________________________________________
dev-tech-network mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-network