问题
I was behind a proxy when I setup play framework. I edited the ~/.activator/activatorconfig.txt file and it worked fine.
Now I need to remove that proxy to work on a different network. I commented out the line but the activator script still tries to use the proxy for connection, when I run ./activator new (or ./activator ui). The file currently looks like this
# This are the proxy settings we use for activator
# Multiple proxy hosts can be used by separating them with a '|' sign
# Do not enclose the proxy host(s) in quotes
#-Dhttp.proxyHost=10.10.78.22
#-Dhttp.proxyPort=3128
# Here we configure the hosts which should not go through the proxy.# You should include your private network, if applicable.
-Dhttp.nonProxyHosts="localhost|127.0.0.1"
# These are commented out, but if you need to use authentication for your proxy, please fill these out.
#-Dhttp.proxyUser=(my_username)
#-Dhttp.proxyPassword=(my_password)
Also when I run ./activator from the root directory of a previously created project, the browser opens but the request never gets completed. Is that because of the proxy or some other reason?
I am new to this framework and any help or tips would be great?
Thanks in advance
PS: Internet connection from terminal works fine.
回答1:
trying lots of possible combinations I could actually find a non standard solution:
activator -Dhttp.proxyHost="your proxyname" -Dhttp.proxyPort="your port" -Dhttps.proxyHost="your proxyname" -Dhttps.proxyPort="your port" -Dhttp.nonProxyHosts="localhost|127.0.0.1" ~run
Notice that in "your proxyname" you do not have to include http:// nor https://
The "Re-Launching Activator Behind A Proxy" description from typesafe documentation in https://www.typesafe.com/activator/docs doesn't work for me (may be I have some missing configuration in my ubuntu system).
Using activator-1.3.5-minimal, java version "1.8.0_51", Ubuntu 14.04 LTS
ReneX
回答2:
in activator.bat above all code below @echo off:
set HTTP_PROXY=http://host:port
set HTTPS_PROXY=https://host:port
set HTTP_PROXY_USER=user
set HTTP_PROXY_PASSWORD=password
after couple of day i manage to make it work... laborious (version 2.5.X)
来源:https://stackoverflow.com/questions/30522747/change-proxy-settings-in-play-framework