Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I tell playframework to use my corporate proxy?

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?

like image 348
The Trav Avatar asked Dec 13 '10 01:12

The Trav


Video Answer


4 Answers

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 var http_proxy: http://docs.python.org/library/urllib.html#high-level-interface

So, you might try setting a proxy through that ENV variable.

like image 192
Adam Vandenberg Avatar answered Oct 03 '22 12:10

Adam Vandenberg


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.

like image 36
niels Avatar answered Oct 03 '22 12:10

niels


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.

like image 32
Codemwnci Avatar answered Oct 05 '22 12:10

Codemwnci


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/

like image 27
Will Iverson Avatar answered Oct 01 '22 12:10

Will Iverson