0

so I have a web application using vue with vuex which has a connection to a websocket via vue-socket-io like this:

Vue.use(new VueSocketIO({
  debug: true,
  connection: SocketIO('http://192.168.0.31:5000'),
  vuex: {
    store,
    actionPrefix: 'SOCKET_',
  },
}));

new Vue({
  router,
  store,
  vuetify,
  render: (h) => h(App),
}).$mount('#app');

My problem is, that besides this websocket, I now need to communicate with yet another server also via websocket. How can I have two websockets with different servers at the same time?

I found a similar question here but I am not sure, if the answer to "just not use vue-socket-io because it won't work" is correct or if there is a way to accomplish this? In this question the user tried to use two stores which I also don't know if it is a food idea?

Thanks for any hint on how I can solve this problem!

1 Answer 1

1

Apparently with vuex and the way shown above only one websocket can be connected like this. The only way to connect another on was to locally do it in the components.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.