whatsapp-web-reveng icon indicating copy to clipboard operation
whatsapp-web-reveng copied to clipboard

ECONNREFUSED on connecting to 127.0.0.1:2020, but using a dummy WS client works

Open danbulant opened this issue 4 years ago • 11 comments

Hello. I was trying to make this thing work but it didn't. The problem is I always get (after connecting to API and clicking "connect to backend") ECONNREFUSED on 127.0.0.1:2020. My first thought was that the python server wasn't working, so I separated the processes (launched them in multiple PowerShells 6) and looked for any logs, but nothing other than the normal "running on port..." and the ECONNREFUSED showed. I also tried connecting to the Python WS server using browser console and it successfully made connection (and python console also showed a connection was made). The problem is then with the node.js implementation. Maybe in /index.js:37?

Running windows 10 build 19025 (Slow ring Insider preview).

Running node index.js as administrator didn't solve the problem.

danbulant avatar Dec 18 '19 15:12 danbulant

image

This showed after clicking the connect to backend button in client/index.html

danbulant avatar Dec 18 '19 16:12 danbulant

same error here

[0] [nodemon] 1.19.4 [0] [nodemon] to restart at any time, enter rs [0] [nodemon] watching dir(s): . [0] [nodemon] watching extensions: js [0] [nodemon] starting node index.js [1] [nodemon] 1.19.4 [1] [nodemon] to restart at any time, enter rs [1] [nodemon] watching dir(s): . [1] [nodemon] watching extensions: py [1] [nodemon] starting python ./backend/whatsapp_web_backend.py [1] Traceback (most recent call last): [1] File "./backend/whatsapp_web_backend.py", line 15, in [1] from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket; [1] ImportError: No module named SimpleWebSocketServer [1] [nodemon] app crashed - waiting for file changes before starting... [0] whatsapp-web-reveng API server listening on port 2019 [0] whatsapp-web-reveng HTTP server listening on port 2018

rodrigolmacedo avatar Dec 18 '19 19:12 rodrigolmacedo

@rodrigolmacedo That's not the same error - my error is in connection to Python backend (but the Node webserver works) while your's about missing module SimpleWebSocketServer. Try installing all deps. (SimpleWebSocketServer is found in my setup)

danbulant avatar Dec 20 '19 15:12 danbulant

@danbulant yes thanks, now im getting the SSL_ERROR hahahaha

rodrigolmacedo avatar Dec 20 '19 16:12 rodrigolmacedo

I have got the same message and was searching for a solution. afbeelding Could it be the firewall from our computers?

LithiumNL avatar Dec 31 '19 11:12 LithiumNL

Could it be the firewall from our computers?

It isn't firewall, as firewall blocks connection from outside.Also, if it was firewall, the connection from another ws client wouldn't work. On Dec 31, 2019 12:09 PM, LithiumNL [email protected] wrote:I have got the same message and was searching for a solution.

danbulant avatar Dec 31 '19 12:12 danbulant

It isn't firewall, as firewall blocks connection from outside.Also, if it was firewall, the connection from another ws client wouldn't work. On Dec 31, 2019 12:09 PM, LithiumNL [email protected] wrote:I have got the same message and was searching for a solution. Could it be the firewall from our computers? —You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe. Sent via Migadu.com, world's easiest email hosting>

True true, forgot that. Happy new year! I just tried it on a Ubuntu system and it works perfect. No problems at all. There are some differences between Ubuntu and Windows i guess.

LithiumNL avatar Jan 01 '20 15:01 LithiumNL

Oh ok, will try on my linux too then

danbulant avatar Jan 07 '20 19:01 danbulant

Hi, I got the same message You find problem? Windows 10

image

artmanxxx avatar Feb 27 '20 11:02 artmanxxx

I was having the same issue, using Windows 10, running the python backend with WSL2,

Changing the websocket url to IPv6 localhost (::1) made it work for me

image

hernanrz avatar Mar 03 '20 19:03 hernanrz

Passing the String "127.0.0.1" to the first parameter of SimpleWebSocketServer() method at the end of "whatsapp_web_backend.py" file, allowed me to workaround it.

Screenshot_2

YHWH-Algorithm avatar May 16 '20 22:05 YHWH-Algorithm