Page 1 of 1

Plugin python - Connection function

Posted: Saturday 05 August 2023 16:26
by pipiche
from the documentation of the python framework, the API Connection() should allow to bind on a specific IP and Port, however whatever IP I'm using I'm always get bound to 0.0.0.0

the call:

Code: Select all

        self.httpServerConn = Domoticz.Connection(
            Name="Zigate Server Connection", 
            Transport="TCP/IP", 
            Protocol="HTTP",
            Address="127.0.0.1",
            Port="9441"
        )

if we print self.httpServerConn, we got the right information
"Name: 'Zigate Server Connection', Transport: 'TCP/IP', Protocol: 'HTTP', Address: '127.0.0.1', Port: '9441', Baud: -1, Timeout: 0, Connected: False, Parent: 'None'"

but if you do netstat to see the binding, this doesn't match the expectations

Code: Select all

~/dev-domoticz/plugins (development *=)$ sudo netstat -plutn | grep 9441
tcp 0 0 0.0.0.0:9441 0.0.0.0:* LISTEN 21268/domoticz

Re: Plugin python - Connection function

Posted: Thursday 10 August 2023 16:08
by pipiche
any id, how we can bind to a specific IP:port instead of 0.0.0.0:port ?