2

I was testing out the threepenny-gui package for Haskell gui programming. Following instructions here, I did:

$ cd threepenny-gui-0.4.1.0/samples/
$ runhaskell.exe Chat.hs

and got:

Listening on http://0.0.0.0:8023/
[29/Apr/2014:11:37:44 -0400] Server.httpServe: START, binding to [http://0.0.0.0
:8023/]

But nothing happens after then. No browser is fired up. Also, if I open firefox and go to http://0.0.0.0:8023/ , it says Unable to connect. I've turned off windows firewall, but it didn't improve anything.

Did I missing anything here?

thor
  • 21,418
  • 31
  • 87
  • 173

1 Answers1

2

Strange. I tested http://127.0.0.1:8023 a minute later instead of the hinted address http://0.0.0.0:8023/, and the gui is visible from the browser immediately. Don't know why the wrong address was suggested.

thor
  • 21,418
  • 31
  • 87
  • 173
  • 1
    In Windows, unlike in Linux, `0.0.0.0` can't be used as an alias for navigating to `localhost`/`127.0.0.1`. Though it is a bit confusing in this context (I found out about that issue in the same way as you did!), the message isn't technically incorrect. The server, which is located in `127.0.0.1`, is telling you that it is listening to incoming connections on `0.0.0.0`, which is shorthand for all network interfaces – duplode Apr 29 '14 at 18:42
  • I see. Thanks for pointing this out. Is there a reference for this shorthand? It looks almost like a subnet mask to me. – thor Apr 29 '14 at 21:29
  • So if I understand it correctly, this is not a standard behavior, but a convention among some? – thor Apr 30 '14 at 02:34
  • Quoting [Wikipedia](https://en.wikipedia.org/wiki/0.0.0.0): "A way to specify 'any IPv4-interface at all'. It is used in this way when configuring servers (i.e. when binding listening sockets). This is known to TCP programmers as INADDR_ANY." And here [a question about INADDR_ANY](http://stackoverflow.com/q/16508685/2751851). As far as I can tell, the use of `0.0.0.0` by Threepenny/Snap is standard; the only thing that isn't is using `0.0.0.0` to navigate to `localhost` in a browser. – duplode Apr 30 '14 at 02:55