I did specify proxy type 1 and i did specify proxy port. As i said before, setting proxy itself works, but works only once. Nex time i modify proxy hostname and port it remains unchanged for later network queries. Specifying localhost proxy and then new socks proxy doesnt seem to help also.
2009/7/20, Johnson <[email protected]>: >> nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID)); >> nsresult nsres=prefs->SetCharPref("network.proxy.socks", >> proxy.hostName()); > > I use this means too, no problem, but may be a little different, my > code: > > nsCOMPtr<nsIPref> pref = do_GetService(NS_PREF_CONTRACTID); > if (pref) > { > if (PROXY_ENABLED) > { > pref->SetIntPref("network.proxy.type", 1); > pref->SetCharPref("network.proxy.http", PROXY_HOST); > pref->SetIntPref("network.proxy.http_port", PROXY_PORT); > } > } > > The differences are: > 1. you didn't specify network.proxy.type, whose default value is 0 > meaning no proxy > 2. you didn't give ght port number (for socks proxy, i don't know) > > >> if (prefService) { >> prefService->SavePrefFile(nsnull); >> prefService->ResetPrefs(); >> prefService->ReadUserPrefs(nsnull); >> } >> does not help too >> >> setting browser offline and then online by nsIIOService also doesnt seem >> to > > I didn't use these two means. > _______________________________________________ > dev-embedding mailing list > [email protected] > https://lists.mozilla.org/listinfo/dev-embedding > _______________________________________________ dev-embedding mailing list [email protected] https://lists.mozilla.org/listinfo/dev-embedding
