Prepared server code for https. Added a self signed certificate.