How to embed discussions on localhost?

Hello,

I have following setup:
-ubuntu (linux) installed and working on windows 10.
-I have discourse is running on this linux and available on “localhost:9292”
-I have a web app (react) is working on this linux machine and avilable on “localhost:3000”

The code I have on this web app is:

  <script type="text/javascript">
    DiscourseEmbed = {
      discourseUrl: "http://localhost:9292/",
      discourseEmbedUrl:
        "http://localhost:3000/#/state/1"
    };

    (function() {
      var d = document.createElement("script");
      d.type = "text/javascript";
      d.async = true;
      d.src = DiscourseEmbed.discourseUrl + "javascripts/embed.js";
      (
        document.getElementsByTagName("head")[0] ||
        document.getElementsByTagName("body")[0]
      ).appendChild(d);
    })();
  </script>

The problem is I get error like this :
“Failed to execute ‘postMessage’ on ‘DOMWindow’: The target origin provided (‘http://localhost:9292’) does not match the recipient window’s origin (‘http://localhost:3000’).”

Maybe discourse is not working on localhost? do I have to have a domain name or is there any way to make it work on localhost?

BTW, I have this configs on discourse

I have exactly the same problem

Also having the same issue. Any luck?