You can pass data from your html component to your page and from your page to the html component by using onMessage and postMessage as shown in the example and API links below.
https://support.wix.com/en/article/corvid-working-with-the-html-element
https://www.wix.com/corvid/reference/$w.HtmlComponent.html
Please note however, that if your html code is from a third party then Wix will not be able to provide you with support for it and you will need to go back to your third party code provider for more help with it.
https://support.wix.com/en/article/using-iframes-to-display-visible-content-on-your-site
Wix cannot provide support for external codes that were not created or tested with Wix.
If you are experiencing an issue with your code snippet, please contact the provider directly.
Plus, as also noted on that above linked page too, is that all iframes are sandboxed on the free version of Wix, whereas on premium sites they are not sandboxed.
To do it within the html code, then you can add something like this to your existing html code.
<script type="text/javascript">
window.parent.location.href = "http://www.my-new-url.com"
</script>