How to ensure security in desktop application using WebSockets locally?

I am developing an application containing both Python backend and frontend using Electron. There is no authentication. The two components communicate through WebSocket. How should I prevent the third party from connecting to the port?

Continue reading How to ensure security in desktop application using WebSockets locally?