Bug 301424 - [Browser] Integrated browser should use proxy settings as configured in Eclipse
Summary: [Browser] Integrated browser should use proxy settings as configured in Eclipse
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.8   Edit
Hardware: PC Linux
: P3 normal with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2010-02-01 10:39 EST by Jacek Pospychala CLA
Modified: 2021-02-26 09:27 EST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jacek Pospychala CLA 2010-02-01 10:39:40 EST
At the moment there's no way to configure integrated browser proxy settings.
Integrated browser should use Eclipse proxy preferences.
Comment 1 Martin Oberhuber CLA 2013-03-11 19:05:16 EDT
CQ:WIND00407760

I have done a fair bit of investigation on this; the problem seems to occur only on Linux, when the web browser component ("xulrunner") is relatively old. I believe that the Browser not reacting to UI Preferences is extremely unintuitive, so I'm marking this as a defect rather than enhancement request. I think the problem is in the SWT.

There are actually two problems, older xulrunners (eg 1.9.0) only react to environment variables, and they do not accept a "network address" like 127.0.0.0/8 for the NO_PROXY environment variable. The GNOME control panel, however, seems to like setting NO_PROXY=localhost,127.0.0.0/8

Steps to reproduce:
1. Download xulrunner-1.9.0
2. setenv HTTP_PROXY http://foo.bar:8080
3. setenv NO_PROXY localhost,127.0.0.0/8
4. ./eclipse -vmargs -Dorg.eclipse.swt.browser.XULRunnerPath=/tmp/xul \
           -Dorg.eclipse.swt.browser.DefaultType=mozilla

Regardless of what I set in the Preferences or how often I quit and re-start Eclipse, the Browser does not pick up the network settings. This is unexpected and also not documented in the SWT FAQ.

Following workarounds are possible,
(A) setenv NO_PROXY localhost,127.0.0.1,127.0.0.0/8
(B) When the host OS provides it, Webkitgtk can be installed as the browser
    component, it supports network addresses for NO_PROXY. On RHEL 6.3, 
    this works:
        yum install webkitgtk.i686
(C) Xulrunner can be updated and used from the System, newer versions do
    accept network addresses for NO_PROXY:
        yum install xulrunner.i686

Personally, I think it is a defect in the SWT Browser component that it allows environment variables to take precedence over the Eclipse UI setup for proxies.
 
I'd understand, though, when the SWT team is not interested fixing this for older xulrunners; therefore, I think the minimum that should be done is the SWT team updating their FAQ. Some information there is incorrect, since it doesn't talk about the NO_PROXY environment variable, the need for BOTH localhost and 127.0.0.1, and the xulrunner accepting only setup from the environment.
Comment 2 Martin Oberhuber CLA 2013-03-11 19:07:45 EDT
See also bug 308035 for a Windows variant of the issue.
Comment 3 Martin Oberhuber CLA 2013-03-11 19:12:30 EDT
I think that the SWT FAQ's advice to use System Properties for Proxy Settings is also not accurate any more. The posting that helped me find the real issue is

http://unix.stackexchange.com/questions/23452/set-a-network-range-in-the-no-proxy-environment-variable
Comment 4 Brian de Alwis CLA 2013-06-14 13:25:59 EDT
I just stumbled into this too.

(In reply to comment #1)
> I have done a fair bit of investigation on this; the problem seems to occur
> only on Linux, when the web browser component ("xulrunner") is relatively
> old.

It also happens when using the WebKit-based browser.

> I believe that the Browser not reacting to UI Preferences is extremely
> unintuitive, so I'm marking this as a defect rather than enhancement
> request. I think the problem is in the SWT.

The editor-based and view-based browsers are in org.eclipse.ui.browsers, but we're unable to propagate the Eclipse-hosted proxy information to the browser.  In the WebKit browser, the proxy information is configured on instance creation, and there are no facilities for changing it.

...

Looking a bit further, it seems that the webkit browser can be configured to use the GNOME proxy settings:

https://bugs.webkit.org/show_bug.cgi?id=25263#c22
> Concluding it is a one-liner to add the GNOME proxy resolver to GNOME applications, we shouldn't do that in WebKitGTK+. And http_proxy can be handled in libsoup, I filed https://bugzilla.gnome.org/show_bug.cgi?id=605048 for that. So this is resolved as far as WebKitGTK+ is concerned.


I have no idea how difficult this "one-liner" would be for SWT, but it would definitely promote a better user experience.
Comment 5 Oleg Kaynov CLA 2017-08-29 05:59:45 EDT
Still reproducible, are there any updates?
Comment 6 Eric Williams CLA 2019-01-08 17:11:39 EST
We'll investigate this for 4.11.
Comment 7 Eric Williams CLA 2019-02-05 11:42:49 EST
Moving into 4.12.
Comment 8 Eric Williams CLA 2019-05-08 09:31:24 EDT
I haven't forgotten about this, but time has run out for me to look at it in 4.12, it's on my list for 2019-09 (4.13).
Comment 9 Samir Huremovic CLA 2019-06-27 07:00:54 EDT
So this is probably the cause for not being able to save my preferences with oomph or using marketplace favorties, right?

Many people behind corporate proxies should have this problem then.
Comment 10 Lidia Popescu CLA 2021-02-26 09:27:49 EST
I'm also affected by this bug. 
I am using eclipse 4.15.0.v20200305-0155 on RHEL7 OS inside a network using a proxy. 'Use internal web browser' is selected in Preferences. And I can't pass proxy settings to used browsers.
Nothing related to this works, getting connection time out:
  - Help -> Eclipse User Storage -> Open My Account
  - Help -> Eclipse User Storage -> Open Marketplace Favorites
  - Preferences -> Oomph -> Setup Tasks -> Preferences Synchronizer -> Synchronize Now with eclipse
  - I also tried to integrate Teams StackOverflow API and can't do authorization in eclipse internal browser because of this issue.
Are there a solution for this?