Use postMessage only if socket.io is not available in iframe