webhookrelay / node-red-contrib-webhookrelay

8 stars 2 forks source link

auto-reconnect possible #1

Closed gusman80 closed 5 years ago

gusman80 commented 5 years ago

hei folks, i think this node is a great addition to my private setup. It works perfectly for some hours on deploy of my flow on node-red, but after a while the tunnel isn't working anymore. (1) Is there a cyclic autorefresh/autoreconnect option for this node to keep the tunnel alive? (2) The node has no input, so i can't retrigger the tunnel manually on my flow after every hour for example ... Or is there any other trick? Thanks for your help

rusenask commented 5 years ago

Hi @gusman80, thanks for the kind words! There was this issue with previous version when it used https://www.npmjs.com/package/webhookrelay-ws-client < 0.4.0 version. From 0.4.0 there's a constant ping from server side with client auto respond. Can you check which version of webhookrelay-ws-client do you have installed?

gusman80 commented 5 years ago

Hi thanks for your quick reply.

i checked npm view webhookrelay-ws-client version returns 0.4.0 i forced a reinstall of the package but the problem persists ...

u have another idea?

rusenask commented 5 years ago

Alright, yeah then it's a problem. Since it's server pings to the client, I think I can add some logic to the webhookrelay-ws-client to reconnect if some pings get missing. This would ensure that it reconnects.

I am personally using it with Node-RED on some flows that don't receive messages for days and still remain working. Do you have any firewall on your side that could be cutting long-lived connections?

rusenask commented 5 years ago

Hi @gusman80, I have published a new version 0.2.2 with these new checks.

gusman80 commented 5 years ago

thank you for this quick fix.

i updated , restarted

i am using a std. telecommunication provider via fibre in germany. the router is a standard router with NAT & Firewall, any special restrictions. the internet connection is reset by provider once or twice a day (new dynamic ip etc).

will let you know asap.

gusman80 commented 5 years ago

init log Feb 6 18:47:45 raspberrypi Node-RED[9730]: subscribed to webhook stream successfully Feb 6 18:47:45 raspberrypi Node-RED[9730]: 6 Feb 18:47:45 - [info] [webhookrelay:be528fb3.55843] webhook relay status event received: 'subscribed', message: 'subscribed to buckets: '

rusenask commented 5 years ago

that's expected, let's see what happens in a few hours :)

rusenask commented 5 years ago

@gusman80 how is it looking so far? does the issue persist?

gusman80 commented 5 years ago

after 2 days of testing i can say it works like a charm now =) thx for the quick fix cheers, markus