# Use global variable in http request url

**URL:** <https://discourse.nodered.org/t/use-global-variable-in-http-request-url/62693>\
**Category:** General\
**Tags:** http-request\
**Created:** [16 May 2022 13:27 UTC](https://discourse.nodered.org/t/use-global-variable-in-http-request-url/62693 "2022-05-16T13:27:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tiramisupxl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tiramisupxl/32/61647_2.png) [@Tiramisupxl](https://discourse.nodered.org/u/Tiramisupxl)\
**Post date:** [16 May 2022 13:27 UTC](https://discourse.nodered.org/t/use-global-variable-in-http-request-url/62693/1 "2022-05-16T13:27:57Z")

</div>

Is there possible use global variable in url of http request node.  
like: http:{{global.ip}}/tset

And how to use variable in websocket url?  
If I have many flows and use the same websocket server, how to set different websocket url like, ws://test/${uuid}, different flow have different uuid

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [16 May 2022 14:39 UTC](https://discourse.nodered.org/t/use-global-variable-in-http-request-url/62693/2 "2022-05-16T14:39:51Z")

</div>

Click once on the http request node, read the documentation tab.

You can send a `msg.url` to the http request node, leave the address empty.

Websockets are statically defined. You can make a single socket end-point and based on the received data, route it through flows.

---

<div class="post-metadata">

**Author:** ![Tiramisupxl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tiramisupxl/32/61647_2.png) [@Tiramisupxl](https://discourse.nodered.org/u/Tiramisupxl)\
**Post date:** [24 May 2022 08:08 UTC](https://discourse.nodered.org/t/use-global-variable-in-http-request-url/62693/3 "2022-05-24T08:08:53Z")

</div>

Thanks for your reply. The first question I have solved by using the msg.xx. but the second question still not resolved,can you give some examples? If one flow will be execute many times in one moment, how can I figure the exexuted flows.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [24 May 2022 08:45 UTC](https://discourse.nodered.org/t/use-global-variable-in-http-request-url/62693/4 "2022-05-24T08:45:38Z")

</div>

This is the rough idea, send data to the websocket that specifies the "destination" you want the data to travel in the flow. ie. you listen on a single websocket and make decisions based on input message. With a switch node you can route the message.

 ![Screenshot 2022-05-24 at 10.43.50](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/a/5adaf50d36863915ebc4246204b81dcf88fe3198.jpeg)

---

<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:** [23 July 2022 08:46 UTC](https://discourse.nodered.org/t/use-global-variable-in-http-request-url/62693/5 "2022-07-23T08:46:12Z")

</div>

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