私は(IntelliJ IDEまたはsbtコマンドラインから)この非常に基本的なディスパッチスニペットをプロキシの背後から実行しようとしています:
import dispatch._
val svc = url("http://api.hostip.info/country.php")
val country = Http(svc > as.String)
println(country())
そして私が得ることができるのは例外です:
java.net.ConnectException: Connection timed out: no further information to
http://api.hostip.info/country.php java.util.concurrent.ExecutionException:
java.net.ConnectException: Connection timed out: no further information
to http://api.hostip.info/country.php
決定的な結果なしで通常のvmパラメーターを設定しようとしました:
-Dhttp.proxyHost=
_my_proxy_host_ -Dhttp.proxyPort=80
、それでも同じ例外が発生しました。
一方、次のスニペットはうまく機能します:
import dispatch._
val svc = url("http://api.hostip.info/country.php") setProxyServer(new com.ning.http.client.ProxyServer(myproxyhost,80))
val country = Http(svc > as.String)
println(country())
見た目もスカラっぽくもないので、そんな時は本当にそういうことなのかしら。
よろしくお願いします。