By the port the electrum server use. Port 50002 is used for secure connection, while port 50001 is used for insecure connection.
Is this written on electrum's source code? A port number doesn't prove anything unless there's a script (on your compiled version of electrum) that differentiate connections based on the port number.
True, but it require you to run a Bitcoin node, which download or/and store 350 GB+ blockchain.
Why does it require to run a node? Once you broadcast a transaction to the network from your Bitcoin client, you essentially send only the transaction along with its signature. You don't provide any evidence that you've downloaded the entire chain. I was having a similar discussion with
Coding Enthusiast on
SharpPusher and he responded that instead of using a block explorer's API, you could broadcast the transaction on Bitcoin nodes. I don't think that he's implemented it, but it is possible:
Denovo feature: broadcast transactions #1.
Since Electrum relies on 3rd party servers, you don't know what is in the code ran on the server (remember when they added the links to the phishing Electrum?). It clearly has all it needs to spy on you if the server owner want to.
I guess they've fixed backdoors of the software since then. Yes, I've read about that incident, much worse than just ruining your privacy.
You can also use Tor and .onion servers with your Electrum wallet to improve your privacy, and I think electrum should think of adding some easy switch option for this just like Wasabi and Trezor Suite have.
Speaking of privacy and Wasabi, can you CoinJoin transactions on electrum? As for tor, I've tried connecting to some nodes, but failed. I guess I'll create a different thread for that.