使用 dispatch.Http 时如何设置代理服务器?

问题描述:

我的代码如下所示:

  val r = :/(srv, 80) <:< Map("Cookie" -> "Scale=Scout%20Pro")
  implicit val http = new Http with NoLogging
  val rBeg = r / "endSessionRedirect.do"
  http(rBeg <<? Map("r" -> to) >|)

它工作正常,但现在我需要通过代理路由它.我该怎么做?

It works properly, but now I need to route it through a proxy. How can I do this?

我想我虽然更容易,毕竟它是 Java,所以传递 Java 代理选项是有效的:

I guess it was easier that I though, it is Java underneath after all, so passing the Java proxy options works:

-Dhttp.proxyHost=localhost -Dhttp.proxyPort=8001