Socket (TCP and Socket.io) monitoring script (input XML)