Using the IntelliJ proxy settings from a plugin

Hi all,

I want to enable proxy support for my ivy integration plugin and have it use  the IntelliJ proxy server settings when configured. I browsed through the  openapi packages and found the HttpConfigurable class. I've changed my code to  call the following method befor accessing an url:

private void prepareURL(URL  dest) throws IOException  {
    HttpConfigurable.getInstance().prepareURL(dest.toExternalForm());
}


but it does not seem to do the trick; it just acts as if no proxy was  configured.

Can anyone point me in the right direction? Or does anyone know of a plugin  that already does a similar thing and from which I could learn?

Thanks!

Guy



2 comments
Comment actions Permalink

HttpConfigurable.getInstance().setAuthenticator(); should do the trick (didn't verify)

0
Comment actions Permalink

Hi Yann,

Thanks for the reply!
I don't think calling setAuthenticator() will help much though, as it is the first thing that the prepareURL() method on HttpConfigurable does.

Cheers,

Guy

0

Please sign in to leave a comment.