working demo via sockets