Replacing HttpConfigurable in an IntelliJ Plugin
Read proxy configuration, obtain endpoint credentials, and open platform-aware connections with the IntelliJ proxy APIs.
The replacement for HttpConfigurable is spread across several APIs. A plugin inspecting the HTTP Proxy settings needs a different operation from a plugin sending a request through them.
| Existing use | Migration API |
|---|---|
| Read the selected proxy configuration | ProxySettings.getInstance().getProxyConfiguration() |
| Retrieve known credentials or ask the user | ProxyAuthentication |
| Obtain credentials for the configured static endpoint | getStaticProxyCredentials, a Kotlin extension exposed through ProxyUtils to Java |
| Open a URL using platform proxy selection | HttpConnectionUtils.openConnection(location) or openHttpConnection(location) |
For the migration API represented by the 2024 IntelliJ Platform sources, these networking types live in com.intellij.util.net. For example, Kotlin can inspect the configuration and look up known static-proxy credentials without prompting:
import com.intellij.util.net.ProxyAuthentication
import com.intellij.util.net.ProxyCredentialProvider
import com.intellij.util.net.ProxySettings
import com.intellij.util.net.getStaticProxyCredentials
val settings = ProxySettings.getInstance()
val configuration = settings.getProxyConfiguration()
val credentials = settings.getStaticProxyCredentials(
ProxyCredentialProvider(
ProxyAuthentication.getInstance()::getKnownAuthentication
)
)
The helper requires a ProxyCredentialProvider; the method reference adapts the authentication service to that interface. Credentials are looked up by the configured proxy’s host and port. A null result can mean the configuration is not static, so it does not establish that a PAC-selected proxy needs no authentication.
When the actual task is making an HTTP request, use the platform connection helper instead of reconstructing routing from host and port fields. It consults the platform’s proxy selector for the destination URL. Converting a static configuration with asJavaProxy() does not honor its exception list and does not implement PAC selection.
If interactive authentication is required, ProxyAuthentication.getPromptedAuthentication(prompt, host, port) is a separate, potentially blocking operation. Keep that distinction when migrating code, and check API availability against the plugin’s minimum supported Platform SDK.