Code: Select all
import json
from websocket import create_connection
ws = create_connection("ws://localhost:9000")
#ws.send(json.dumps({"event":"auth","data":{"user":"www-data","password":"23scadoo"}}))
ws.send(json.dumps({"event":"auth","data":{"user":"<www-data>","password":"<23scadoo>"}}))
result = ws.recv()
print (result)
ws.close()
File "soxw.py", line 3, in <module>
ws = create_connection("ws://192.168.0.104:9000")
File "/usr/local/lib/python3.8/dist-packages/websocket/_core.py", line 596, in create_connection
websock.connect(url, **options)
File "/usr/local/lib/python3.8/dist-packages/websocket/_core.py", line 249, in connect
self.sock, addrs = connect(url, self.sock_opt, proxy_info(**options),
File "/usr/local/lib/python3.8/dist-packages/websocket/_http.py", line 130, in connect
sock = _open_socket(addrinfo_list, options.sockopt, options.timeout)
File "/usr/local/lib/python3.8/dist-packages/websocket/_http.py", line 208, in _open_socket
raise err
File "/usr/local/lib/python3.8/dist-packages/websocket/_http.py", line 185, in _open_socket
sock.connect(address)
ConnectionRefusedError: [Errno 111] Connection refused
I have turned off SSL in zmeventnotification.pl
DEFAULT_SSL_ENABLE => 'no',
And in zmeventnotification.ini , I added a password
# the password for accepting control interfaces
#######escontrol_interface_password=!ESCONTROL_INTERFACE_PASSWORD
escontrol_interface_password="23scadoo"
If anyone has any trouble shooting ideas, please let me know. Thank you!