有没有办法通过自动代理配置脚本配置 Eclipse IDE 代理设置?

发布于 2024-09-26 05:15:13 字数 548 浏览 2 评论 0原文

我位于使用自动代理配置脚本的防火墙后面。当我在我使用的大多数浏览器(IE 7、IE 8、FF、Chrome)中启用自动代理 URL 时,我可以浏览互联网。 供您在 Windows 上启用自动代理 url 的参考,请转到:设置 ->控制面板->互联网选项 ->连接->局域网设置-> (勾选)使用自动配置脚本->输入地址值作为自动代理脚本 url。

我面临的问题是:我有 Eclipse IDE,我想在 Eclipse 中配置类似于浏览器设置的代理设置,但我无法做到。我在 Eclipse 或 NetBeans 6.9.1 或 IntelliJ Idea 中找不到解决此问题的设置。

我正在使用与这些 IDE 集成的 Maven2,并且尚未设置本地存储库。 Maven2 尝试通过从 Internet 下载 jar 来安装它们,但由于代理设置而无法安装。我可以从 Maven2 存储库手动下载这些库,并使用 Artifactory 或 Nexus 托管一个内部存储库,但我想知道是否有任何方法可以从 IDE 本身执行此操作...

感谢您的反馈。如果您有任何疑问,请告诉我。

I am behind a firewall which uses autoproxy configuration script. I am able to browse the internet when I enable the autoproxy url in most browsers I use (IE 7, IE 8, FF, Chrome). For your reference to enable autoproxy url on Windows goto: Settings -> Control Panel -> Internet Options -> Connections -> Lan Settings -> (Check) use automatic configuration scripts -> enter Address value as the autoproxy script url.

The issue I am facing is: I have Eclipse IDE and I want to configure the proxy settings in Eclipse similar to browser settings but I am unable to. I could not find a setting in Eclipse or NetBeans 6.9.1 or IntelliJ Idea to solve this issue.

I am using Maven2 integrated with these IDEs and no local repositories set up yet. Maven2 tries to install jars by downloading them from Internet but it cannot due to the proxy setting. I can manually download these libraries from Maven2 repositories and have an internal repository hosted using Artifactory or Nexus but I would like to know if there is any way I can do it from IDE itself...

Thanks for your feedback. Please let me know if you have any questions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

家住魔仙堡 2024-10-03 05:15:13

这就是我所做的。所有这些说明都是基于我使用 PAC 的最少经验,所以 YMMV。

通过 pac URL 下载 pac 文件。它是纯文本,应该很容易在文本编辑器中打开。

在底部附近,可能有一个部分内容如下:
返回“PROXY wxyz:a”
其中“wxyz”是 IP 地址或用户名,“a”是端口号。

把这些写下来。

在最新版本的 eclipse 中:

  • 转到 Window ->首选项->一般->网络连接 =
  • 将提供商更改为“手动”
  • 选择“HTTP”行并单击编辑按钮
  • 将上面的 IP 地址和端口号添加到 http 行
  • 如果您必须进行身份验证才能使用代理,
    • 选择“需要身份验证”
    • 输入您的用户名。请注意,如果您的身份验证是在 Windows 域上进行的,则可能需要在前面添加域名和反斜杠 (\),例如:MYDOMAIN\MYUSERID
    • 输入您的密码
  • 单击“确定”
  • 单击“应用”
  • 单击“确定”

此时,您应该能够浏览使用内部 Web 浏览器(至少在 http URL 上)。

祝你好运。

编辑
正如您所知,使用 Nexus 更容易,一组 < ;mirror> 标签和单个代理设置(Nexus 内部)来管理防火墙内 Maven 的代理问题。

Here is what I do. All of these instructions are based on my minimal experiences with working PACs, so YMMV.

Download your pac file via your pac URL. It's plain text and should be easy to open in a text editor.

Near the bottom, there's probably a section that says something like:
return "PROXY w.x.y.z:a"
where "w.x.y.z" is an ip address or username and "a" is a port number.

Write these down.

In a recent version of eclipse :

  • Go to Window -> Preferences -> General -> Network Connections=
  • Change the provider to "Manual"
  • Select the "HTTP" line and click the edit button
  • Add the IP address and port number above to the http line
  • If you have to authenticate to use the proxy,
    • select "Requires Authentication"
    • type in your username. Note that if your authentication is on a Windows domain, you might have to prepend the domain name and a backslash (\) like: MYDOMAIN\MYUSERID
    • Type in your password
  • Click OK
  • Click Apply
  • Click OK

At this point, you should be able to browse using the internal web browser (at least on http URLs).

Good luck.

Edit:
Just so you know, it's WAY easier to use Nexus, one set of <mirror> tags and a single proxy setup (inside Nexus) to manage the proxy issues of Maven inside a firewall.

回心转意 2024-10-03 05:15:13

在文件中:
$your_eclipse_installation\configuration.settings\org.eclipse.core.net.prefs

您需要以下选项:
systemProxiesEnabled=true

您也可以通过 Eclipse GUI 设置它:
转到窗口 ->首选项->一般->网络连接
将提供程序更改为“Native”

即使您的 Eclipse 由于错误的配置尝试而损坏,第一种方法仍然有效。

In the file:
$your_eclipse_installation\configuration.settings\org.eclipse.core.net.prefs

you need the option:
systemProxiesEnabled=true

You can set it also by the Eclipse GUI:
Go to Window -> Preferences -> General -> Network Connections
Change the provider to "Native"

The first way is working even if your Eclipse is broken due to wrong configuration attempts.

維他命╮ 2024-10-03 05:15:13

下载您的浏览器正在使用的任何配置脚本。

该脚本将具有各种主机:端口配置。
根据您要连接的域,浏览器选择主机:端口之一。

在 Eclipse 网络设置中,您可以尝试打开主机端口并查看是否有效。

为我工作。

配置脚本看起来像,

if (isPlainHostName(host))
    return "DIRECT";
else if (dnsDomainIs(host, "<***sample host name *******>"))
    return "PROXY ***some ip*****; DIRECT";
else if (dnsDomainIs(host, "address.com")
        || dnsDomainIs(host, "adress2..com")
        || dnsDomainIs(host, "address3.com")
        || dnsDomainIs(host, "address4.com")        
    return "PROXY <***some proxyhost****>:8080";

您需要在返回语句中查找主机端口。

Download whatever configuration script that your browser is using.

the script would have various host:port configuration.
based on the domain you want to connect , one of the host:port is selected by the borwser.

in the eclipse network setting you can try to put on of the host ports and see if that works.

worked for me.

the config script looks like,

if (isPlainHostName(host))
    return "DIRECT";
else if (dnsDomainIs(host, "<***sample host name *******>"))
    return "PROXY ***some ip*****; DIRECT";
else if (dnsDomainIs(host, "address.com")
        || dnsDomainIs(host, "adress2..com")
        || dnsDomainIs(host, "address3.com")
        || dnsDomainIs(host, "address4.com")        
    return "PROXY <***some proxyhost****>:8080";

you would need to look for the host port in the return statement.

转身泪倾城 2024-10-03 05:15:13
Download proxy script and check last line for return statement Proxy IP and Port.
Add this IP and Port using these step.

   1.  Windows -->Preferences-->General -->Network Connection
   2. Select Active Provider : Manual
   3.  Proxy entries select HTTP--> Click on Edit button
   4.  Then add Host as a proxy IP and port left Required Authentication blank.
   5.  Restart eclipse
   6.  Now Eclipse Marketplace... working.
Download proxy script and check last line for return statement Proxy IP and Port.
Add this IP and Port using these step.

   1.  Windows -->Preferences-->General -->Network Connection
   2. Select Active Provider : Manual
   3.  Proxy entries select HTTP--> Click on Edit button
   4.  Then add Host as a proxy IP and port left Required Authentication blank.
   5.  Restart eclipse
   6.  Now Eclipse Marketplace... working.
鹊巢 2024-10-03 05:15:13

嗯,有“网络连接”首选项页面;您可以在那里添加代理。我对此了解不多;我不知道 Maven 集成插件是否会使用那里定义的代理。

您可以在“窗口...首选项”、“常规...网络连接”中找到它。

Well there's the Network Connections preference page; you can add proxies there. I don't know much about it; I don't know if the Maven integration plugins will use the proxies defined there.

You can find it at Window...Preferences, then General...Network Connections.

梦毁影碎の 2024-10-03 05:15:13

在Netbeans中,我们可以使用工具->选项->选项。常规选项卡 - >在代理设置下,选择使用系统代理设置。

这样,它就使用“设置”->“设置”中提供的代理设置。控制面板->互联网选项 ->连接->局域网设置->使用自动配置脚本。

如果您使用的是 Maven,请确保此处未提供代理设置,以便它使用上面提供的 Netbeans 设置进行代理。

希望这有帮助。

什里德维

In Netbeans, we can use Tools->Options-> General Tab - > Under proxy settings, select Use system proxy settings.

This way, it uses the proxy settings provided in Settings -> Control Panel -> Internet Options -> Connections -> Lan Settings -> use automatic configuration scripts.

If you are using maven, make sure the proxy settings are not provided there, so that it uses Netbeans settings provided above for proxy.

Hope this helps.

Shreedevi

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文