Mycroft Community Forum

Websocket response

I am able to send a query to mycroft core running on my localhost via docker.
my query is - ‘where is california’ and I see the response in the skills.log as

2021-09-17 02:31:23.812 | INFO | 25 | QuestionsAnswersSkill | Searching for where is california
California is located on the West Coast of the United States. It shares borders with Oregon, Nevada, and Arizona

However, my websocket client doesn’t see any response.

my client code closed the websocket immediately. I kept it running for a while, and I can see all responses.

import websocket
import threading
from time import sleep

def on_message(ws, message):
messageDict = json.loads(message)
if ‘type’ in messageDict and messageDict[“type”] == ‘speak’:
print ("--------------------------------")

def on_close(ws):
print("### closed ###")

if name == “main”:
ws = websocket.WebSocketApp(uri,
on_message = on_message,
on_close = on_close)
wst = threading.Thread(target=ws.run_forever)
wst.daemon = True

conn_timeout = 5
while not ws.sock.connected and conn_timeout:
    conn_timeout -= 1

msg_counter = 0
while ws.sock.connected: