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

ECONNREFUSED error when connecting to API #317

Open
IamMusavaRibica opened this issue Mar 21, 2021 · 6 comments
Open

ECONNREFUSED error when connecting to API #317

IamMusavaRibica opened this issue Mar 21, 2021 · 6 comments

Comments

@IamMusavaRibica
Copy link

IamMusavaRibica commented Mar 21, 2021

Using windows 10
I tried disabling firewall
Command prompt output

[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`
[2] Sass is watching for changes. Press Ctrl-C to stop.
[2]
[0] whatsapp-web-reveng API server listening on port 2019
[0] whatsapp-web-reveng HTTP server listening on port 2018
[0] got message  { command: 'api-connectBackend', from: 'client', type: 'call' }
[0] events.js:292
[0]       throw er; // Unhandled 'error' event
[0]       ^
[0]
[0] Error: connect ECONNREFUSED 127.0.0.1:2020
[0]     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
[0] Emitted 'error' event on WebSocket instance at:
[0]     at WebSocket.finalize (C:\Users\IamMusavaRibica\OneDrive\Desktop\whatsapp-web-reveng\node_modules\ws\lib\WebSocket.js:182:41)
[0]     at ClientRequest.<anonymous> (C:\Users\IamMusavaRibica\OneDrive\Desktop\whatsapp-web-reveng\node_modules\ws\lib\WebSocket.js:647:10)
[0]     at ClientRequest.emit (events.js:315:20)
[0]     at Socket.socketErrorListener (_http_client.js:469:9)
[0]     at Socket.emit (events.js:315:20)
[0]     at emitErrorNT (internal/streams/destroy.js:106:8)
[0]     at emitErrorCloseNT (internal/streams/destroy.js:74:3)
[0]     at processTicksAndRejections (internal/process/task_queues.js:80:21) {
[0]   errno: -4078,
[0]   code: 'ECONNREFUSED',
[0]   syscall: 'connect',
[0]   address: '127.0.0.1',
[0]   port: 2020
[0] }
[0] [nodemon] app crashed - waiting for file changes before starting...```
@Pegorino82
Copy link

@IamMusavaRibica have you solved the problem?

@IamMusavaRibica
Copy link
Author

IamMusavaRibica commented Apr 20, 2021 via email

@Pegorino82
Copy link

@IamMusavaRibica yes, i found some import's loss in whatsapp.py and in whatsapp_web_backend.py in creating SimpleSocketServer it is needed to specify host '127.0.0.1'
that's work for me, but script needs refactor and upgrade

@IamMusavaRibica
Copy link
Author

@IamMusavaRibica yes, i found some import's loss in whatsapp.py and in whatsapp_web_backend.py in creating SimpleSocketServer it is needed to specify host '127.0.0.1'
that's work for me, but script needs refactor and upgrade

where exactly ?

@Pegorino82
Copy link

@IamMusavaRibica

 whatsapp_web_backend.py
 ...
 at the bottom
 ...
 
server = SimpleWebSocketServer("127.0.0.1", 2020, WhatsAppWeb);
eprint("whatsapp-web-backend listening on port 2020");
server.serveforever();

@IamMusavaRibica
Copy link
Author

IamMusavaRibica commented May 22, 2021 via email

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