Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to instantiate connection inside a component? #4

Closed
jokeronaldo opened this issue Jul 28, 2016 · 6 comments
Closed

Is there a way to instantiate connection inside a component? #4

jokeronaldo opened this issue Jul 28, 2016 · 6 comments

Comments

@jokeronaldo
Copy link

Is possible to connect inside a component? I mean, not in main.js but in a module, something like Login.vue

@jefflam
Copy link

jefflam commented Jul 31, 2016

Got the same question as well!

@pinguinjkeke
Copy link

Stuck with same

@jokeronaldo
Copy link
Author

LOL, duplicated but where is the first issue link?

@gk4m
Copy link

gk4m commented Jan 3, 2017

It is possible to init connection in component? not in main.js?

@edoecohen
Copy link

@MetinSeylan any thoughts on this? Would be great if you could instantiate the socket connection not in main.js and not when app is created, but later, say after user has logged in.

@jacobgoh101
Copy link

jacobgoh101 commented Aug 22, 2019

it can be done by through socket.io options and API

https://socket.io/docs/client-api/#socket-open

Vue.use(new VueSocketIO({
    connection: SocketIO('http://metinseylan.com:1992', {   autoConnect: false }),
  })
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants