Hosts configuration for simple spray server?

20 views
Skip to first unread message

Denis Papathanasiou

unread,
Aug 30, 2015, 5:25:27 AM8/30/15
to spray.io User List
Using the example from https://github.com/spray/spray-template I can build
and run a simple http server using the default interface as "localhost"
and the port 8080.

Checking with curl on localhost:8080 or http://127.0.0.1:8080 works.

But when I try using the host's ip address or local dns name fails,
giving me a "curl(7) couldn't connect to host" error.

In contrast, when I try python's built-in http server on the same port --
"python -m SimpleHTTPServer 8080" -- I can connect using curl to all three
(localhost/127.0.0.1, ip address, dns name).

Is there some type of hosts configuration I also need when running my
spray server?

Johannes Rudolph

unread,
Aug 30, 2015, 6:06:09 AM8/30/15
to spray...@googlegroups.com
Hi Denis,

have you tried binding to 0.0.0.0? Otherwise, it will only listen on
the localhost interface and it depends on your dns configuration if
hosts are resolved to localhost.

Johannes
> --
> You received this message because you are subscribed to the Google Groups
> "spray.io User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to spray-user+...@googlegroups.com.
> Visit this group at http://groups.google.com/group/spray-user.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/spray-user/51843cd8-6916-4de0-ac1c-5816a51894de%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Johannes

-----------------------------------------------
Johannes Rudolph
http://virtual-void.net

Denis Papathanasiou

unread,
Aug 31, 2015, 9:31:18 PM8/31/15
to spray.io User List
Thanks, Johannes, that worked!
Reply all
Reply to author
Forward
0 new messages