Get port and actual server IP in Scala or Play Framework 2.x
This executes a shell command in Scala and returns the actual server IP instead of 127.0.0.1 or the domain name of the host. #| is used to simulate piping of commands. Process and Seq are used for awk as $NF will lead to compilation errors otherwise. The actual shell command is: ip route get 8.8.8.8 …
Continue reading “Get port and actual server IP in Scala or Play Framework 2.x”