mirror of https://github.com/sbt/sbt.git
Print addresses the server listens on
This commit is contained in:
parent
774a599bdd
commit
9b66d5a2ec
|
|
@ -1,6 +1,7 @@
|
|||
package coursier
|
||||
|
||||
import java.io.{ File, FileOutputStream }
|
||||
import java.net.NetworkInterface
|
||||
import java.nio.channels.{ FileLock, OverlappingFileLockException }
|
||||
|
||||
import org.http4s.dsl._
|
||||
|
|
@ -11,6 +12,8 @@ import org.http4s.{ BasicCredentials, Challenge, EmptyBody, Request, Response }
|
|||
|
||||
import caseapp._
|
||||
|
||||
import scala.collection.JavaConverters._
|
||||
|
||||
import scalaz.concurrent.Task
|
||||
|
||||
case class SimpleHttpServerApp(
|
||||
|
|
@ -200,9 +203,16 @@ case class SimpleHttpServerApp(
|
|||
b
|
||||
}
|
||||
|
||||
if (verbosityLevel >= 0)
|
||||
if (verbosityLevel >= 0) {
|
||||
Console.err.println(s"Listening on http://$host:$port")
|
||||
|
||||
if (verbosityLevel >= 1 && host == "0.0.0.0") {
|
||||
Console.err.println(s"Listening on addresses")
|
||||
for (itf <- NetworkInterface.getNetworkInterfaces.asScala; addr <- itf.getInetAddresses.asScala)
|
||||
Console.err.println(s" ${addr.getHostAddress} (${itf.getName})")
|
||||
}
|
||||
}
|
||||
|
||||
builder
|
||||
.run
|
||||
.awaitShutdown()
|
||||
|
|
|
|||
Loading…
Reference in New Issue