WebSocket failure with packaged build

I’m creating an app that uses WebSocket. My app works fine in development, but not when I package it up. In the packaged version, WebSocket is able to connect, but then it very shortly disconnects with no explanation. I’ve tried packaging with both electron-builder and electron-packager.

Any ideas? I’m not sure even where to start looking.

I’m using these versions:

"node": "10.16.0"
"electron": "^8.3.3",
"electron-builder": "^22.7.0",