# Embed Node-RED into mean express on the same port in an iframe

**URL:** <https://discourse.nodered.org/t/embed-node-red-into-mean-express-on-the-same-port-in-an-iframe/785>\
**Category:** General\
**Created:** [13 June 2018 09:27 UTC](https://discourse.nodered.org/t/embed-node-red-into-mean-express-on-the-same-port-in-an-iframe/785 "2018-06-13T09:27:59Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![Dr.legendaddy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dr.legendaddy/32/1014_2.png) [@Dr.legendaddy](https://discourse.nodered.org/u/Dr.legendaddy)\
**Post date:** [19 June 2018 08:45 UTC](https://discourse.nodered.org/t/embed-node-red-into-mean-express-on-the-same-port-in-an-iframe/785/21 "2018-06-19T08:45:30Z")

</div>

thanks I got it working now using [socket.io](http://socket.io) to communicate from the angular components to the express server that has the red api.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [19 June 2018 11:30 UTC](https://discourse.nodered.org/t/embed-node-red-into-mean-express-on-the-same-port-in-an-iframe/785/22 "2018-06-19T11:30:20Z")

</div>

> [@Dr.legendaddy](#):
>
> thanks I got it working now using [socket.io](http://socket.io) to communicate from the angular components to the express server that has the red api.

One last point. You _can_ do this the other way around as well. You can use Node-RED as your Express server and use node-red-contrib-uibuilder with Angular.

---

<div class="post-metadata">

**Author:** ![Dr.legendaddy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dr.legendaddy/32/1014_2.png) [@Dr.legendaddy](https://discourse.nodered.org/u/Dr.legendaddy)\
**Post date:** [19 June 2018 11:33 UTC](https://discourse.nodered.org/t/embed-node-red-into-mean-express-on-the-same-port-in-an-iframe/785/23 "2018-06-19T11:33:45Z")

</div>

cool! Thats something to keep in mind! Either way I’m really happy its working now and I can communicate to RED via [socket.io](http://socket.io) from my ng services 🤗  
thanks again for the ggod tips!

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [19 June 2018 11:39 UTC](https://discourse.nodered.org/t/embed-node-red-into-mean-express-on-the-same-port-in-an-iframe/785/24 "2018-06-19T11:39:17Z")

</div>

No problem. I should have said that uibuilder actually creates the [Socket.IO](http://Socket.IO) connection for you. But you still have to install your other dependencies - e.g. Angular - there are various examples in the WIKI.

---

<div class="post-metadata">

**Author:** ![Dr.legendaddy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dr.legendaddy/32/1014_2.png) [@Dr.legendaddy](https://discourse.nodered.org/u/Dr.legendaddy)\
**Post date:** [19 June 2018 11:41 UTC](https://discourse.nodered.org/t/embed-node-red-into-mean-express-on-the-same-port-in-an-iframe/785/25 "2018-06-19T11:41:58Z")

</div>

sweet!!! should be a great starting point on further learning on the internal functionality and how to marry it all with angular 👍

---

<div class="post-metadata">

**Author:** ![gambhirpulkit](https://avatars.discourse-cdn.com/v4/letter/g/ee59a6/32.png) [@gambhirpulkit](https://discourse.nodered.org/u/gambhirpulkit)\
**Post date:** [14 March 2019 07:14 UTC](https://discourse.nodered.org/t/embed-node-red-into-mean-express-on-the-same-port-in-an-iframe/785/26 "2019-03-14T07:14:14Z")

</div>

Hi.  
I'm using the same steps as you did to run embedded node-red app but I'm getting handshake error while the node-red app is running. I'm using nodejs version v10.15.1

@Dr.legendaddy

EDIT: In above code of @Dr.legendaddy two http servers are created due to which websocket handling is sat on different server. Hence getting handshake error. Just use one server in bin/www

---

<div class="post-metadata">

**Author:** ![rula018](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@rula018](https://discourse.nodered.org/u/rula018)\
**Post date:** [19 June 2019 02:48 UTC](https://discourse.nodered.org/t/embed-node-red-into-mean-express-on-the-same-port-in-an-iframe/785/27 "2019-06-19T02:48:08Z")

</div>

@Dr.legendaddy by any chance do you happen to have your code on a repo? I am starting to explore the same thing. I am stuck on displaying the ui '/red' from a angular component.

[Previous page](https://discourse.nodered.org/t/embed-node-red-into-mean-express-on-the-same-port-in-an-iframe/785.md?page=1)
