All valid point. I have updated the code to avoid STDIO and added some error handling. For my own learning I would be interested what you would now change. The main issue now is that if a client hangs writing to the proxy it will block. What is the best approach to this sort of issue? Can you point me towards the best docs?