How to start any server of weboscket or socket.io in electron?

The test code can be found here: https://github.com/StringKe/electron-test

I need to use the websocket server in electron. During the process of trying, I found that the ws (npm package) used does not seem to be packaged, and ws cannot be found during startup.

Has anyone successfully used socket.io or websocket server in Electron?

FWIW, I’m using the dgram package and it gets the job done for me.