Rewrite SocketStream app - add routing and fix ESC