# Refuse IP Connections

**URL:** <https://discourse.nodered.org/t/refuse-ip-connections/47570>\
**Category:** General\
**Created:** [24 June 2021 08:11 UTC](https://discourse.nodered.org/t/refuse-ip-connections/47570 "2021-06-24T08:11:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexander77](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@alexander77](https://discourse.nodered.org/u/alexander77)\
**Post date:** [24 June 2021 08:11 UTC](https://discourse.nodered.org/t/refuse-ip-connections/47570/1 "2021-06-24T08:11:40Z")

</div>

Due to workload circumstances i want to allow a maximum of 10 connections to a tcp server at an specified port. How can i refuse an 11th connection without affecting the existing connections?

In addition, is it possible to make an indicator on the gui, something like a led, to indicate an active connection? The TCP-in node itself displays it in the flow.

Thank you!

---

<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:** [24 June 2021 08:57 UTC](https://discourse.nodered.org/t/refuse-ip-connections/47570/2 "2021-06-24T08:57:55Z")

</div>

> [@alexander77](#):
>
> In addition, is it possible to make an indicator on the gui, something like a led, to indicate an active connection? The TCP-in node itself displays it in the flow.

Point a status node at the TCP-in node - connect a debug set to show complete message to see what comes out of the status node as TCP connections are added + removed.

> [@alexander77](#):
>
> How can i refuse an 11th connection without affecting the existing connections?

I'm not sure that is possible however you could possibly monitor `msg._session` and when you have logged 10, dont respond to the 11th+ (not pretty but might work?)

---

<div class="post-metadata">

**Author:** ![alexander77](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@alexander77](https://discourse.nodered.org/u/alexander77)\
**Post date:** [24 June 2021 09:25 UTC](https://discourse.nodered.org/t/refuse-ip-connections/47570/3 "2021-06-24T09:25:19Z")

</div>

Thx for the quick response, i will try that tonight.

---

<div class="post-metadata">

**Author:** ![alexander77](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@alexander77](https://discourse.nodered.org/u/alexander77)\
**Post date:** [24 June 2021 20:28 UTC](https://discourse.nodered.org/t/refuse-ip-connections/47570/4 "2021-06-24T20:28:17Z")

</div>

Status node does what i need. Thaks for that.  
msg.\_session does not bring anything new. Will try to build a table with msg.ip entries and try the 'not pretty' solution.

Thanks for the reply!

---

<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 August 2021 20:28 UTC](https://discourse.nodered.org/t/refuse-ip-connections/47570/5 "2021-08-23T20:28:51Z")

</div>

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