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 - Introduce API for network proxy settings
Summary: Introduce API for network proxy settings
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 7.0
Hardware: All All
: P2 normal (vote)
Assignee: Jiri Rechtacek
Depends on:
Reported: 2011-01-20 15:32 UTC by Jiri Rechtacek
Modified: 2011-06-24 18:43 UTC (History)
5 users (show)

See Also:
Exception Reporter:

proposal API for proxy settings (13.00 KB, patch)
2011-01-27 17:55 UTC, Jiri Rechtacek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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
Comment 5 Jesse Glick 2011-06-24 18:43:51 UTC
Shouldn't we be using 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.