Post localhost requests lead to Unix.ECONNREFUSED
I tried this example : https://github.com/aantron/hyper/blob/master/example/2-post/post.ml
and also a simple program which only do a post request to a personal local server, i always get Fatal error: exception Unix.Unix_error(Unix.ECONNREFUSED, "connect", ""). I tried with http://localhost:8080/ too.
The server listen on the good port, it works on my browser, my firewall is off, i don't understand why it doesn't work :/ any help ?
I played around with this and it looks like it is some kind of mapping of IPv6 that causes the problem. Try to set "localhost" to "[::1]" instead (so basically "http://[::1]:8080/"). This fixed the problem for me. But I am 99% sure this is not a hyper bug but a bug in the underlaying libraries.