title: How to request specific data using node and websockets?
body: <p>I have a some simple code inside an Express server that connects to a public websocket server endpoint using <a href="https://github.com/nathanboktae/robust-websocket#usage" rel="nofollow noreferrer">ws</a>:</p>
  <pre><code>const DYDX_BASE_WSS_STAGING_URL = 'wss://api.stage.dydx.exchange/v3/ws';
  
  const ws = new WebSocket(`${DYDX_BASE_WSS_STAGING_URL}`);
  
  ws.addEventListener('open', (event) =&gt; {
      console.log('EVENT ----------------&gt;', event);
  })
  
  ws.addEventListener('message', (event) =&gt; {
      console.log('we got: ' + event.data)
  })
  </code></pre>
  <p>The connection to the server is successful, however I need to retrieve data about specific markets. In the <a href="https://docs.dydx.exchange/?python#markets" rel="nofollow noreferrer">dydx docs</a> fields are provided to get this data. it says &quot;to subscribe&quot;:</p>
  <blockquote>
  <p>type  string  Set to subscribe</p>
  </blockquote>
  <blockquote>
  <p>channel   string  Set to v3_markets</p>
  </blockquote>
  <p>My question is, how do I add these fields to the request I'm making with 'ws' to receive the market data?</p>