Another WebSocket woes post - WS connection closes after +-5 minutes

PhantomBot Version: 3.0.0 (Revision: fcc08b51)
Operating System: Linux
Java Version: 1.8.0_191-8u191-b12-2ubuntu0.16.04.1-b12
Browser and Version (for Panel Support): Chrome Version 73.0.3683.86 (Official Build) (64-bit)
Stock PhantomBot: Yes (I think. Uses 25000-25003 ports, and HTTPS)

Let us know what help you need:

Hello!

As per title, the /ytplayer page seems to be opening a web socket connection no problem, and is accepting requests from chat without problem and is responsive to button commands in the /ytplayer page, like play, shuffle etc.

However, after around 5 minutes WS gets closed, and I get that JS toast message which fires when onclose function is executed.

I tried connecting from my PC via “telnet to my.server.name 25003” command - it did so successfully, and after 5 minutes got “Connection closed by foreign host.” message in terminal.

It’s a VPS box.

Stuff I tried: enabling/disabling https - same results

Any thoughts on how to fix this are greatly appreciated!!

My guess is this. We have seen some VPS providers that auto-close connections that are idle for a period of time. Some services go as low as 2 minutes. If you are seeing the connection close after 5-minutes when there is no traffic, it may very well be the VPS is dropping connections that are idle after a period of time.

I don’t believe the Control Panel constantly sends data back and forth like the YouTube Player - which has songs, and status updates, which are sent pretty often.

I will double check the Control Panel and see if we can provide a PING/PONG service that may alleviate the issue, if that is what is going on.

1 Like

PR2129 creates a PING/PONG operation between the Core and the Panel. The operation occurs every 2 minutes. This will be in the next Nightly Build. I am curious if this helps to alleviate the issue.

You know what it seems this has solved the issue! I’ve been running my /ytplayer for solid 30 min now and it’s still responsive!

Excellent work, thank you so much! (and if anything changes, I’ll reply here)

1 Like

Excellent! Will keep this then as part of the next release.

Thank you for the feedback, it helps!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.