Websockets keep timing out



I am trying to set up websockets for the application that i’m developing , so the problem is that they keep disconnecting after some time , around 10-15 minutes with this error :
“error”: “Could not connect to websocket endpoint ws://localhost:4466/. Please check if the endpoint url is correct.”
I would like to know if there is a way to prevent that from happening since in the application that I’m building i need them to be open for longer periods of times even if no data is sent trough them.