server icon indicating copy to clipboard operation
server copied to clipboard

Add possibility to bind AMCP port to specific IP address

Open nerijus opened this issue 4 months ago • 0 comments

Currently AMCP port 5250 listens on all interfaces:

ss -nlp|grep 5250
tcp   LISTEN 0      4096                                              0.0.0.0:5250             0.0.0.0:*    users:(("casparcg",pid=3534544,fd=112))

So it is possible for everyone from internet to connect to it and send commands (unless it is firewalled). With this PR it is possible to specify IP addr like this:

--- casparcg.config.orig	2025-07-18 15:26:29.000000000 +0000
+++ casparcg.config	2025-08-14 15:31:52.387490375 +0000
@@ -19,6 +19,7 @@
     </channels>
     <controllers>
         <tcp>
+            <host>127.0.0.1</host>
             <port>5250</port>
             <protocol>AMCP</protocol>
         </tcp>

Now it listens on 127.0.0.1 only:

ss -nlp|grep 5250
tcp   LISTEN 0      4096                                            127.0.0.1:5250             0.0.0.0:*    users:(("casparcg",pid=965101,fd=113))

This PR was made with the help of AI. If <host>127.0.0.1</host> is omitted, then it behaves like before. The value should be IP addr, not hostname.

nerijus avatar Aug 14 '25 15:08 nerijus