I have a server hosted on a digital ocean droplet running ubuntu. 2 GB Memory / 50 GB Disk / SFO2 - Ubuntu 25.04 x64
The server is built using docker and runs off of the VM on a container with a traefik server that acts as the reverse proxy connecting to the backend server. Ports are open on 8080 and are correctly configured for the client because it does connect and is able to transmit data for a while. No firewalls just yet.
The server communicates with clients sending data and messages. The connection only holds for 30s - 5 minutes at most and then it drops with the message.
11/19/2025 17:01:53|Fatal|WebSocket.<startReceiving>b__176_2|System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.NetworkStream'.
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
at WebSocketSharp.Ext.<>c__DisplayClass48_0.<ReadBytesAsync>b__0(IAsyncResult ar)
I tried creating a barebones server and client project with similar set and the same issue occurs. Connect to remote on client -> wait -> (Client)“Receive failed: The remote party closed the WebSocket connection without completing the close handshake.”
Is digital ocean network cutting out and disposing of network connections? Is there any way to hold longer connections? If anyone uses similar configurations I would really appretiate the help as I am fairly new to remote hosting on servers.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.