如何告诉 playframework 使用我的公司代理?
我正在尝试开始使用 play Web 框架及其 scala 支持,
不幸的是“安装 scala”失败,因为 play 无法获取模块站点。
我的系统设置对于公司代理来说是正确的,但是游戏似乎没有使用它们。
是否有某处的配置文件或我需要设置一些环境属性才能播放以获取它们?
I'm trying to get started with the play web framework and its scala support,
unfortunately "install scala" fails because play can't fetch the module site.
I've got my system settings correct for the corporate proxy, however play doesn't seem to use them.
Is there a config file somewhere or some environment properties I need to set for play to pick them up?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
用 Python 实现的安装命令在后台使用 ulrlib: https://github.com/playframework/play/blob/master/framework/pym/play/commands/modulesrepo.py#L73
urllib
库允许设置通过 ENV varhttp_proxy
的代理: http: //docs.python.org/library/urllib.html#high-level-interface因此,您可以尝试通过该 ENV 变量设置代理。
The install command, implemented in Python, uses ulrlib behind the scenes: https://github.com/playframework/play/blob/master/framework/pym/play/commands/modulesrepo.py#L73
The
urllib
library allows setting a proxy via the ENV varhttp_proxy
: http://docs.python.org/library/urllib.html#high-level-interfaceSo, you might try setting a proxy through that ENV variable.
我认为它仅适用于尚未发布的 1.1.1。请参阅错误 210。我不确定,但我认为列表模块和安装使用相同的代码来获取代理。
您可以手动安装它。
I assume that it's only working with 1.1.1 which isn't released yet. See bug 210. I'm unsure but I think list-modules and install are use the same code to get the proxy.
You can install it manually.
您确定模块位置没有被代理阻止吗?您是否能够通过浏览器访问该 URL,或者如果您在 Linux 上运行,则可以使用 wget 访问该 URL?
您想要的网址是 http://www.playframework.org/modules/scala-head.zip 。
如果您可以访问它,您只需下载该文件并直接解压到播放模块即可。无论如何,这就是安装命令所做的全部事情。
are you sure that the modules location is not blocked by the proxy? Are you able to access the URL via your browser, or if you are running on Linux, using wget?
URL you want is http://www.playframework.org/modules/scala-head.zip.
If you can access it, you can simply download the file and unzip into the play modules directly. That is all the install command does anyway.
我强烈建议使用 Proxifier 等软件来处理企业代理服务器,而不是在应用程序级别上处理它。这将允许您在一个地方控制所有代理配置,并且比尝试更新单个软件包更加无缝。
http://www.proxifier.com/
如果您使用的是 U*nx,请尝试使用 CNTLM。
http://cntlm.sourceforge.net/
I would strongly recommend using software such as Proxifier to deal with corporate proxy servers, not dealing with it on the application level. That will allow you to control all of your proxy configuration in one place, and will also work much more seamlessly than trying to update individual software packages.
http://www.proxifier.com/
If you are on U*nx, try CNTLM instead.
http://cntlm.sourceforge.net/