title: Websockets compatable with dash-extensions (Plotly-Dash)
body: <p>I try to update the data in the Dash from the external client sending websockets. I have tried the next code for minimal Dash application:</p>
  <p>Dash application <strong>app.py</strong></p>
  <pre><code>from dash import html, dcc, Dash, Input, Output, State
  from dash_extensions import WebSocket
  from dash_extensions.websockets import SocketPool, run_server
  
  # Create example app.
  app = Dash(prevent_initial_callbacks=True)
  socket_pool = SocketPool(app)
  app.layout = html.Div([html.Div(id=&quot;msg1&quot;),
                         WebSocket(url=&quot;ws://localhost:8050&quot;, id=&quot;ws2&quot;),
                         ])
  
  @app.callback(Output(&quot;msg1&quot;, &quot;children&quot;),
                [Input(&quot;ws2&quot;, &quot;message&quot;)],
                )
  def update_div(msg):
      return f'Message: {msg}'
  
  
  if __name__ == '__main__':
      pass
      run_server(app, port=8050)  # 5000 if the default port
  </code></pre>
  <p>And another program is client for websocket generation (emulate the uController in the future):
  Websocket client <strong>client.py</strong></p>
  <pre><code>import json
  import websocket
  from websocket import create_connection
  from time import sleep
  
  from icecream import ic
  
  websocket.enableTrace(True)
  ws = create_connection('ws://localhost:8050')
  
  msg = {'data': '0.46641500410263426'}
  
  msg = 0.2324
  data = json.dumps(msg)
  # ws.send(bytes(data, encoding=&quot;utf-8&quot;))
  ws.send(data)
  sleep(1)
  ws.send(data)
  sleep(1)
  ws.send(data)
  
  sleep(2)
  ws.close()
  </code></pre>
  <p>But the Dash app <strong>html.Div(id=&quot;msg1&quot;)</strong> content doesn't updated.</p>
  <p>Can somebody help me with this minimal setup?</p>
  <p>For me the main question is:
  <strong>How the client have to generate websockets to be compatable with <em>dash_extensions</em> websockets?</strong></p>
  <p><em>Or may be alternative solutions are exist to update the dash app content from the external client sending data?</em></p>
  <p>Thanks!</p>