stringify socket without circular reference