This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 194530

Summary: Introduce API for network proxy settings
Product: platform Reporter: Jiri Rechtacek <jrechtacek>
Component: -- Other --Assignee: Jiri Rechtacek <jrechtacek>
Status: RESOLVED FIXED    
Severity: normal CC: anebuzelsky, jglick, mmirilovic, pjiricka, tstupka
Priority: P2 Keywords: API, API_REVIEW_FAST
Version: 7.0   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: proposal API for proxy settings

Description Jiri Rechtacek 2011-01-20 15:32:13 UTC
IDE cannot return static Network Host/Port, Host/Port can vary depending on URL. We need a API to get Network Host/Port for given URL, also we need to know the type of Proxy Settings (direct, auto-detection, manual) and optionally user name and password.
Comment 1 Jiri Rechtacek 2011-01-26 12:11:18 UTC
Based on discussion with Tomas S. I'm going to propose a simple API for getting active proxy settings. A typical use-case for this API is a module which reads proxy setting and does setup external tools for network access. This API will not help to build own UI for proxy settings other than Tools|Options.
I propose to deploy API into Utilities API (i.e. org.openide.util)
The signature could be look like:
========================
public final class NetworkSettings {
static public String ProxySetting.getHost(URI u)
static public String ProxySetting.getPort(URI u)
static public PasswordAuthentication ProxySetting.getPasswordAuthentication(URI u)}
========================
It's just idea, the proposal as diff will be attached before API review. Now, I will make a prototype using this API as a proof of concept.
Comment 2 Jiri Rechtacek 2011-01-27 17:55:59 UTC
Created attachment 105414 [details]
proposal API for proxy settings

Added NetworkSetting class into Utilities API, this API allows get hostname a port of active network proxy for URI given as parameter, also if a proxy requires authentication the API can return username and key for reading password from Keyring.
The implementation and prototype of API usage found on branch proxy-api-194530 over core-main repository.
Thanks for review.
Comment 3 Jiri Rechtacek 2011-02-01 13:11:36 UTC
FYI, I'm going to integrate it tomorrow.
Comment 4 Jiri Rechtacek 2011-02-02 14:21:39 UTC
core-main/rev/677ecc06bfd6
Comment 5 Jesse Glick 2011-06-24 18:43:51 UTC
Shouldn't we be using java.net.useSystemProxies for those systems (Win32, Gnome) where it is available? If I understand correctly, this standard proxy selector would be superior for some purposes to anything we have in the IDE now, since it would handle proxy config changes made while the IDE is running.