title: What are the proper security measures involved with opening a port with Python?
body: <p>Consider a very basic python socket which opens up a port to the internet on the host computer and listens for incoming messages, which are displayed in a terminal.</p>
  
  <p>Keeping a port wide open like this is considered fairly vulnerable, correct? What security features should I implement? Should incoming data be sanitized? What's the best way of going about this? </p>
  
  <p>Thanks.</p>