-
Notifications
You must be signed in to change notification settings - Fork 3
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
connect ECONNREFUSED #19
Comments
Could you send the |
I was told in prosody support MUC that:
and to try on port 5222 but I get an error
I'm running the bot only on WSL. My prosody server runs in a VPS, no network issues. |
Ok it was a port mistake. In my use, both Prosody and bot are on the same host which I called on the fake config below If you're plan to use a TLS connection between bot and Prosody, you should use a service starting with I made a typo on the README, the bot is using @xmpp/client, so you can check their doc for declaring client configuration. Also check that the {
"logger": {
"level": "debug",
"file": {
"active": false,
"pattern": "%d %p %m%n",
"path": "/var/log/xmpp-bot/",
"filename": "xmpp-bot.log"
},
"console": {
"active": false,
"coloured": true
},
"stdout": {
"active": true,
"pattern": "%p %m"
}
},
"webhooksListener": {
"path": "/webhooks",
"port": 8000,
"ssl": {
"port": null,
"certPath": "/etc/letsencrypt/live/fakedomain.com/fullchain.pem",
"keyPath": "/etc/letsencrypt/live/fakedomain.com/privkey.pem"
},
"users": [
{
"login": "dom",
"password": "pwd"
}
],
"accessLog": {
"active": true,
"path": "/var/log/xmpp-bot/",
"filename": "webhook.log"
}
},
"xmppServer": {
"service": "xmpp://fakedomain.com:5222",
"domain": "fakedomain.com",
"username": "bot",
"password": "pwd2",
"resource": "botservice",
"errorReply": "Oops, something went wrong :(",
"rooms": [
{
"id": "dom@conference.fakedomain.com",
"password": null
}
]
},
"incomingWebhooks": [
{
"path": "/webhooks/dom",
"action": "send_xmpp_message"
}
],
"xmppHooks": [
{
"room": "bot@fakedomain.com",
"action": "outgoing_webhook",
"args": ["send_to_dom"]
}
],
"outgoingWebhooks": [
{
"code": "send_to_dom",
"url": "https://192.168.1.15:8081/plugins/Webhook/core/php/jeeWebhook.php?serverId=60",
"timeout": 2000,
"strictSSL": false,
"contentType": "application/json",
"authMethod": "basic",
"user": "xmpp-bot",
"password": "pwd3",
"bearer": null
}
]
} |
Hi, Also I have no idea how webhooks work, so I copied your config for incoming and xmppHooks and tried browsing "http://localhost:8000/webhooks/roughnecks" but I get "Invalid authorization". I guess there should be a way to craft the url by using my login and password I specified in the config, but I am really lost. And finally, is there a rather simple way to strip all of the webhooks stuff just to have a working bot capable of connecting, so maybe I can find a way to code some other stuff for it? Thanks |
I re-read the README and was able to send a curl POST to the webhook and send a message to myself and to the MUC.. Some progress at least :) |
Me again, I used Macrodroid on my phone to receive an outgoing hook but would like to know which are the use cases like in the example you posted. What does it do for you and why any message to the bot triggers the outgoing hook? Sorry for the questions but I never used webhooks before. |
My use case was to setup bidirectional communication with home automation solution I used. |
And yes the message you sent to room or bot is transmitted in outgoing webhook in |
I see, thanks. Got another question if you can help.
I tried a lot of different combos with and without the escaping "<<< >>>" but it always fails. Do you have any experience with IFTTT? Can you help? |
https://help.ifttt.com/hc/en-us/articles/1260803042229#Escapeanytextcontent |
Sorry I do not know about IFTTT. |
At least try to debug with a Node-RED http-in |
I know you closed this, but could you answer this question I posted earlier? |
I closed because there is no issue, but no problem for helping you as much as I can. I'm not very expert in the SSL/TLS stuff but I understood the |
Nice! Thanks again, maybe I will pester you some other time :) |
Hi, it's me again. I was using the bot for quite some time with xmpps on port 5223 (I had set up SRV records) and everything was fine.
I know my certs are not self signed, 1) because they worked before and 2) because I copied them again straight from So I just don't know what's happening.
This ^ in I know it's a lot of stuff going on but if you have any idea... Thanks |
Hi, no idea but can you confirm:
The only thing that can help you from the code view is updating xmpp/client, may be you can copy the app and run a |
Hi, |
The error message you posted is from xmpp module, it happens because something is wrong between this app and your XMPP server (and its certificate). |
I see but I'm quite sure my certificates are ok. Now I completely disabled IPv6 in prosody, restarted it and tried to connect the bot; here's what I'm getting:
I have a second virtualhost in prosody for Jitsi Meet but I don't understand what it has to do with the bot's connection to the main host.
Also I found out that passing this variable before launching node, the bot connects, but I guess it's not safe and shouldn't happen:
|
Found this, maybe worth asking there too? |
It was a good call but not enough: app is using @xmpp/client 0.13.1 and the issue you found was fixed in 0.5.2. But I think you have a certificate/Prosody configuration issue with your 2 certificates (one for each domain ➡️ If you can use the same certificate for both domains (using And yes, using |
yeah, I was aware of that, just thought there might be a regression of some sort.
okay, I am able to connect to secure websocket (wss), so that's a start.
That's correct.
I will take a look, thanks! |
Describe the bug
Hello, not sure if it's a bug but it looks like my server refuses connection to the bot and I just don't know what's the issue.
To Reproduce
Steps to reproduce the behavior:
Logs
Environment (please complete the following information):
npm -v
) 8.19.2node -v
) v18.12.1Additional context
I'm running prosody on Debian Bullseye as well and I see no traces of login or connection attempts in logs.
The text was updated successfully, but these errors were encountered: