# How to find out URL of node-red inside a node?

**URL:** https://discourse.nodered.org/t/how-to-find-out-url-of-node-red-inside-a-node/58893
**Category:** Developing Nodes
**Created:** [23 February 2022 20:18 UTC](https://discourse.nodered.org/t/how-to-find-out-url-of-node-red-inside-a-node/58893 "2022-02-23T20:18:18Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![windkh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/windkh/32/4713_2.png) [@windkh](https://discourse.nodered.org/u/windkh)
#### Post date: [23 February 2022 20:18 UTC](https://discourse.nodered.org/t/how-to-find-out-url-of-node-red-inside-a-node/58893/1 "2022-02-23T20:18:18Z")

</div>

Hi,  
I want to receive a HTTP GET inside my own node like the HTTP-in does it as follows:

RED.httpNode.get('/myprivateroute', cookieParser(), httpMiddleware, corsHandler, metricsHandler, callback, errorHandler);

My question is: how can I determine the full url which is accessible from the local network?  
"[http://IP](http://IP):PORT/myprivateroute"

I found out that the PORT number can be extracted from  
"RED.server.\_connectionKey"  
, however the IP cannot be found there. Any ideas?

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [23 February 2022 20:53 UTC](https://discourse.nodered.org/t/how-to-find-out-url-of-node-red-inside-a-node/58893/2 "2022-02-23T20:53:58Z")

</div>

Hi, what is the reason for wanting to know the IP and port? what is the end goal? Perhaps there is an other / better approach?

NOTE: The IP 127.0.0.1 will obviously work but which IP (or IPs) node-red is accessible on is a completely different kettle of fish (even IF you could get the IP addresses, you still dont know if the IP or Port is blocked by a firewall or non routed for example)

---

<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: [23 February 2022 21:35 UTC](https://discourse.nodered.org/t/how-to-find-out-url-of-node-red-inside-a-node/58893/3 "2022-02-23T21:35:41Z")

</div>

Much of this information is in RED.settings already.

However, the whole thing is complex and has some things to catch you out. I spent quite a lot of time trying to get this right for uibuilder vNext with input from others on dealing with things like what happens when you are behind a reverse proxy.

---

<div class="post-metadata">

### Author: ![windkh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/windkh/32/4713_2.png) [@windkh](https://discourse.nodered.org/u/windkh)
#### Post date: [23 February 2022 21:48 UTC](https://discourse.nodered.org/t/how-to-find-out-url-of-node-red-inside-a-node/58893/4 "2022-02-23T21:48:41Z")

</div>

Thanks, for trying to help to find an alternative, but I simply need the url with ip and port that‘s all. Instead of the IP, the hostname would be ok, too.

---

<div class="post-metadata">

### Author: ![windkh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/windkh/32/4713_2.png) [@windkh](https://discourse.nodered.org/u/windkh)
#### Post date: [23 February 2022 21:50 UTC](https://discourse.nodered.org/t/how-to-find-out-url-of-node-red-inside-a-node/58893/5 "2022-02-23T21:50:01Z")

</div>

Ah ok I see your point, but it is only about devices communicating inside a local network… no internet

---

<div class="post-metadata">

### Author: ![lu4t](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lu4t/32/32276_2.png) [@lu4t](https://discourse.nodered.org/u/lu4t)
#### Post date: [23 February 2022 21:54 UTC](https://discourse.nodered.org/t/how-to-find-out-url-of-node-red-inside-a-node/58893/6 "2022-02-23T21:54:12Z")

</div>

are you trying to access the endpoint from within the same nw segment?

if yes, you might want to have a look at this:

> **[node-red-nodes/io/mdns at c1c82a623e01992e2862d68e65fcc306dd9bcdd1 ·...](https://github.com/node-red/node-red-nodes/tree/c1c82a623e01992e2862d68e65fcc306dd9bcdd1/io/mdns)**
>
> c1c82a623e01992e2862d68e65fcc306dd9bcdd1/io/mdns

---

<div class="post-metadata">

### Author: ![windkh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/windkh/32/4713_2.png) [@windkh](https://discourse.nodered.org/u/windkh)
#### Post date: [24 February 2022 06:58 UTC](https://discourse.nodered.org/t/how-to-find-out-url-of-node-red-inside-a-node/58893/7 "2022-02-24T06:58:20Z")

</div>

@lu4t thanks, I will have a look into the mdns module.

---

<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: [25 April 2022 06:59 UTC](https://discourse.nodered.org/t/how-to-find-out-url-of-node-red-inside-a-node/58893/8 "2022-04-25T06:59:17Z")

</div>

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