Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange bug that leads to Unix.ECONNREFUSED #68

Open
tobiasBora opened this issue Nov 7, 2016 · 1 comment
Open

Strange bug that leads to Unix.ECONNREFUSED #68

tobiasBora opened this issue Nov 7, 2016 · 1 comment

Comments

@tobiasBora
Copy link

Hello,

First thank you for the library. However I'm having some bugs I cannot explain. I manage to make it work between a python server and an ocaml client, but when the ocaml client tries to connect to the well known wscat (sudo apt-get install node-ws) which is run as a server with :

/usr/bin/wscat --listen 8889

I got an error from the client side:

Exception: Unix.Unix_error (Unix.ECONNREFUSED, "connect", "").

The code I'm running is the wscat installed by opam (I also tried to compile it by myself, and the bug stay the same). I checked with netcat the opened port and I find the 8889:

$netstat --listen | grep 8889
tcp        0      0 0.0.0.0:8889            0.0.0.0:*               LISTEN  

Also, I tried to connect to the node wscat using both a node wscat client and a python client running websocket, and both can connect to the server, so it's indeed a bug.

Do you know what could be the reason of such a bug ?

Thank you.

@vbmithr
Copy link
Owner

vbmithr commented Dec 28, 2016

I think the issue you had is that the OCaml wscat client was trying to connect to the IPv6 localhost (::1) instead of 127.0.0.1. Could you please try ./wscat.native "http://127.0.0.1:8889"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants