MetinSeylan / Vue-Socket.io

😻 Socket.io implementation for Vuejs and Vuex
https://metin.sh
MIT License
3.95k stars 496 forks source link

How to connect multiple sockets in a single vuejs project? #310

Open allenshaji opened 3 years ago

allenshaji commented 3 years ago

import VueSocketIOExt from 'vue-socket.io-extended'; import { io } from 'socket.io-client';

const socket = io('http://localhost:3200/'); const socket1 = io('http://localhost:3100/');

Vue.use(VueSocketIOExt, socket); Vue.use(VueSocketIOExt, socket1);

I tried using the above code. But only only socket is working. Is it possible to connect both the sockets simultaneously. Thanks for the help in advance

JAGFx commented 3 years ago

I'm looking for the same feature.

ssyrota commented 3 years ago

+, it's a problem

1shaked commented 3 years ago

1+

Thabet-Do commented 3 years ago

https://jvnior.com/post/2020-08-01-handling-sockets-vue/

AryaCherryLiu commented 3 years ago

I also faced this problem.+1

JAGFx commented 2 years ago

After many search,, the only solution it's to use a SocketIO and a store

This project is no longer useful, and I've a better control on the data sent through the app.

See an example here

ImnotLiAng commented 2 years ago

https://github.com/aripjanovsh/Vue-Socket.io This could help solve the problem