# Does this flow work on your install?

**URL:** https://discourse.nodered.org/t/does-this-flow-work-on-your-install/65838
**Category:** General
**Created:** [31 July 2022 05:25 UTC](https://discourse.nodered.org/t/does-this-flow-work-on-your-install/65838 "2022-07-31T05:25:43Z")
**Posts on this page:** 4
**Page:** 2

<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: [31 July 2022 11:36 UTC](https://discourse.nodered.org/t/does-this-flow-work-on-your-install/65838/21 "2022-07-31T11:36:55Z")

</div>

Only just seen this but I think you are approaching it the wrong way.

As you've already seen, you quickly fall foul of OS differences if you aren't careful.

The node-red port is available from the node-red settings object so that is easy enough.

The IP address varies depending on whether you want the internal or external address.

In node.js, [`os.networkInterfaces()`](https://nodejs.org/api/os.html#os_os_networkinterfaces) will give you the data you want on any platform. All you need to do is grab the data in settings.js and assign to a global variable. No need to make it persistent and you shouldn't do anyway in case the address changes.

Oh, a complexity of course. I you are looking for the nr server address as seen by a client connection, that is actually harder if you need it to be a generic solution. That is because a particular node-red installation might be behind 1 or more proxies which would impact the address that the client would need to connect to.

Really depends on why you want to capture these details and where they will be used.

Not sure if this translates directly to a function node but here is the trace log message from uibulder that reports the node-red server details on startup:

```auto
log.trace(`[uibuilder:web:webSetup] Using Node-RED ExpressJS server at ${RED.settings.https ? 'https' : 'http'}://${RED.settings.uiHost}:${RED.settings.uiPort}${uib.nodeRoot === '' ? '/' : uib.nodeRoot}`)

```

---

<div class="post-metadata">

### Author: ![HaroldPetersInskipp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haroldpetersinskipp/32/42319_2.png) [@HaroldPetersInskipp](https://discourse.nodered.org/u/HaroldPetersInskipp)
#### Post date: [31 July 2022 18:14 UTC](https://discourse.nodered.org/t/does-this-flow-work-on-your-install/65838/22 "2022-07-31T18:14:50Z")

</div>

Yeah, that seem to be what I'm leaning towards using as a starting point (`node.js core os module`).

I guess I need a crash course on "OS checks", "platform independent code" and "extracting the PORT in use of a service/program". Probably a good idea to look into, directory/filesystem structure differences too.

---

<div class="post-metadata">

### Author: ![HaroldPetersInskipp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haroldpetersinskipp/32/42319_2.png) [@HaroldPetersInskipp](https://discourse.nodered.org/u/HaroldPetersInskipp)
#### Post date: [31 July 2022 18:25 UTC](https://discourse.nodered.org/t/does-this-flow-work-on-your-install/65838/23 "2022-07-31T18:25:04Z")

</div>

@bakman2 Does `flow 5` work for your install?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [29 September 2022 18:25 UTC](https://discourse.nodered.org/t/does-this-flow-work-on-your-install/65838/24 "2022-09-29T18:25:43Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/does-this-flow-work-on-your-install/65838.md?page=1)
