title: How to listen to incoming request when configuring vue-socket.io globally in VueJS
body: <p>I would like to know how to listen to an incoming request from a server when configuring vue-socket.io globally in VueJS.
  <br><br></p>
  
  <p>I followed <a href="https://www.npmjs.com/package/vue-socket.io" rel="nofollow noreferrer">vue-socket.io - npm</a> to set up vue-socket.io globally as follows:
  <a href="https://i.stack.imgur.com/U4N4v.png" rel="nofollow noreferrer">configuration file</a></p>
  
  <p>I think the configuration works because it is possible to pass data from a client to a server.
  However, on the client-side, I cannot listen to data from the server.</p>
  
  <p>I tried using <em>socket option</em>, <em>this.$socket.on</em>, <em>this.$socket.subscribe</em>, <em>this.sockets.subscribe</em>, and the results are below:
  <br><br></p>
  
  <p><em>Case</em>: this.$socket.on
    result: doesn't run
  <a href="https://i.stack.imgur.com/QgmGF.png" rel="nofollow noreferrer">case: this.$socket.on</a></p>
  
  <p><em>Case</em>: socket option
    result: doesn't run
  <a href="https://i.stack.imgur.com/AdLDF.png" rel="nofollow noreferrer">case: socket option</a></p>
  
  <p><em>Case</em>: this.$socket.subscribe &amp; this.sockets.subscribe
    result: TypeError: this.$socket.subscribe is not a function
  <br><br></p>
  
  <p>I have attached <a href="https://i.stack.imgur.com/ND7rh.png" rel="nofollow noreferrer">server-side code</a> to clarify my problem.
  <br><br></p>
  
  <p>I would be grateful if you could help me. Thank you in advance.</p>