# Amend REST API port

**URL:** https://discourse.nodered.org/t/amend-rest-api-port/94757
**Category:** General
**Created:** [20 January 2025 15:17 UTC](https://discourse.nodered.org/t/amend-rest-api-port/94757 "2025-01-20T15:17:32Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ScheepersJohan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scheepersjohan/32/39556_2.png) [@ScheepersJohan](https://discourse.nodered.org/u/ScheepersJohan)
#### Post date: [20 January 2025 15:17 UTC](https://discourse.nodered.org/t/amend-rest-api-port/94757/1 "2025-01-20T15:17:32Z")

</div>

Is it possible to change the port for a rest API?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/c/dc8496f2801d62eef62c6ebb0f341a653f0fbc8a.png)

---

<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: [20 January 2025 15:29 UTC](https://discourse.nodered.org/t/amend-rest-api-port/94757/2 "2025-01-20T15:29:29Z")

</div>

No, not unless you change the port Node-RED is running on.

There _might_ be contrib nodes that do this.

Otherwise, use something like HAProxy or NGINX to call the endpoints (i'm sure there are other ways too)

Question - why?

---

<div class="post-metadata">

### Author: ![ScheepersJohan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scheepersjohan/32/39556_2.png) [@ScheepersJohan](https://discourse.nodered.org/u/ScheepersJohan)
#### Post date: [20 January 2025 15:56 UTC](https://discourse.nodered.org/t/amend-rest-api-port/94757/3 "2025-01-20T15:56:47Z")

</div>

I don't want to open up 1880.

And I can't set my security rules to only allow certain IP to access the API, as I don't know them.

I need a crash course in securing the API 🤣

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [20 January 2025 18:35 UTC](https://discourse.nodered.org/t/amend-rest-api-port/94757/4 "2025-01-20T18:35:30Z")

</div>

A little hacky, and messy - but Im just putting it out there.

1. Create A `TCP IN` Node (Any port you want)
2. Connect that to a `TCP Request` Node (to `localhost:1880`)
3. Connect it's output to a `TCP Out` Node (in reply mode)

Don't alter any message properties, and the `TCP IN/Out/Reply` Node will act as a proxy to your Web Service (avoiding public access to port 1880)

* * *

**Don't listen to any of my solution, it should be done the proper (and secure) way, but just sharing the love**

---

<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: [20 April 2025 18:35 UTC](https://discourse.nodered.org/t/amend-rest-api-port/94757/5 "2025-04-20T18:35:38Z")

</div>

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