3
http 프록시를 통해 스칼라에서 URL을 읽을 수 없습니다.http 프록시를 통한 스칼라의 Source.fromURL
는 나는 다음과 같은 오류
(http.proxyHost,158.169.9.13)
(http.proxyPassword,*****)
(http.proxyPort,8012)
(http.proxyUser,*****)
java.io.IOException: Server returned HTTP response code: 407 for URL: http://google.com
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1612)
at java.net.URL.openStream(URL.java:1035)
at scala.io.Source$.fromURL(Source.scala:143)
at scala.io.Source$.fromURL(Source.scala:133)
at Main$$anon$1.<init>(download.scala:7)
at Main$.main(download.scala:1)
at Main.main(download.scala)
나는 google.com 페이지 소스의 인쇄를 기다리고 있었다를 얻을이 코드
//This is just to print the environment
import scala.collection.JavaConversions._
println(System.getProperties.filter(_._1 startsWith("http")).toList sortBy(_._1) mkString "\n")
import scala.io.Source
val html = Source.fromURL("http://google.com")
val s = html.mkString
println(s)
에게 있습니다.