Working example with pos and dir. Sending string instead of bytes.