0

The class HttpConfigurable has been deprecated at version 2024.2, when I use HttpConfigurable.getInstance() to get proxy data such as host, login name, it will warn: 'com. intellij. util. net. HttpConfigurable' is deprecated and marked for removal. Is there other way to get proxy data?

I tried as https://intellij-support.jetbrains.com/hc/en-us/community/posts/206755245-How-to-access-IntelliJ-proxy-data-programmatically said, but warning shows when compiling: warning: [removal] HttpConfigurable in com.intellij.util.net has been deprecated and marked for removal HttpConfigurable proxySettings = HttpConfigurable.getInstance();

1 Answer 1

0

The documentation in HttpConfigurable refers you to the deprecation notices for the specific methods:

/**
* @deprecated Use {@link ProxySettings}, {@link ProxyAuthentication}, {@link HttpConnectionUtils}, and {@link ProxyUtils} instead.
* See method deprecation notices for more details.
* <p/>
* For removal in version 24.3
*/

For example, according to the documentation for getProxyLogin() states that you should use a version of ProxyUtils#getStaticProxyCredentials.

/** @deprecated use {@link ProxyUtils#getStaticProxyCredentials(ProxySettings, ProxyCredentialProvider)} or {@link ProxyUtils#setStaticProxyCredentials(ProxySettings, ProxyCredentialStore, Credentials, boolean)} */
  @Deprecated(forRemoval = true)
  @Transient
  public @Nullable String getProxyLogin() {
    return getSecure("proxy.login");
  }
Sign up to request clarification or add additional context in comments.

2 Comments

Thank you! I tried and found that ProxySettings.getInstance().getProxyConfiguration() can get proxy host and port. Andf ProxyUtils#getStaticProxyCredentials(ProxySettings.getInstance(), (ProxyCredentialProvider) (ProxyCredentialStore.getInstance())) can get user name and password.
Could you elaborate a bit more how exactly to get the host name and port number for manual configured proxy? also how can I know if "No proxy" is selected beforehand.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.