# How to embed discussions on localhost?

**URL:** https://meta.discourse.org/t/how-to-embed-discussions-on-localhost/103896
**Category:** Self-hosting
**Created:** [December 10, 2018, 12:39pm UTC](https://meta.discourse.org/t/how-to-embed-discussions-on-localhost/103896 "2018-12-10T12:39:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![colobot88](https://avatars.discourse-cdn.com/v4/letter/c/779978/32.png) [@colobot88](https://meta.discourse.org/u/colobot88)
#### Post date: [December 10, 2018, 12:39pm UTC](https://meta.discourse.org/t/how-to-embed-discussions-on-localhost/103896/1 "2018-12-10T12:39:24Z")

</div>

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](http://localhost:9292)’) does not match the recipient window’s origin (‘[http://localhost:3000](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

 ![image](https://global.discourse-cdn.com/meta/original/3X/4/b/4bb2722277fe48eeab32281ff446af47500f9f11.png)

---

<div class="post-metadata">

### Author: ![hamsterbacke23](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hamsterbacke23/32/129269_2.png) [@hamsterbacke23](https://meta.discourse.org/u/hamsterbacke23)
#### Post date: [January 16, 2019, 9:34am UTC](https://meta.discourse.org/t/how-to-embed-discussions-on-localhost/103896/2 "2019-01-16T09:34:24Z")

</div>

I have exactly the same problem

---

<div class="post-metadata">

### Author: ![maggiomj](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@maggiomj](https://meta.discourse.org/u/maggiomj)
#### Post date: [April 19, 2019, 5:14pm UTC](https://meta.discourse.org/t/how-to-embed-discussions-on-localhost/103896/3 "2019-04-19T17:14:46Z")

</div>

Also having the same issue. Any luck?
