vue-socket.io-extended | : v : : zap : Socket.io bindings for Vue.js and Vuex | Websocket library
kandi X-RAY | vue-socket.io-extended Summary
kandi X-RAY | vue-socket.io-extended Summary
:v::zap: Socket.io bindings for Vue.js and Vuex (inspired by Vue-Socket.io)
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Defines react - reactive properties .
- register event handler
- Passed action to store .
- Installs a WebSocket socket interface .
- Remove listeners for a given name
- Define socket object .
- Emit an event to a listener .
- Decorator for socket
- Add a listener for a given callback
vue-socket.io-extended Key Features
vue-socket.io-extended Examples and Code Snippets
Community Discussions
Trending Discussions on vue-socket.io-extended
QUESTION
I am trying to set up communication between my nodeJS server and a vueJS app via socket.io. I have been able to get the socket communication working on my main computer so far. When running my node server and my vue app in dev mode, I can open the vue app in the browser and I see the connection coming through my server.
However, when I open the vueJS app on my iPad (connected to the same wifi) the vue app loads and runs fine but my socket connection never goes through. I am also unable to connect to the socket server by opening the vueJS app on differnet PC (also connected to the same wifi as the PC serving the apps) so the iPad is not the issue here.
Could there be something with my local network that would be blocking the connection?
I have tried setting up the socket connection with plain socket.io client, vue-socketIO, and vue-socketIO-extended but each library had the same issue. Here is my code using vue-socketIO-extended:
main.js
...ANSWER
Answered 2022-Mar-16 at 21:32That's because the browser tries to connect to the WS server at http://localhost:3000
, localhost resolves to IP 127.0.0.1 which is the loopback address of your device, on your iPad localhost is the iPad and there is nothing running on 127.0.0.1:3000 on the iPad.
You need to use the IP of the device that runs your server, Ex:
const socket = io('http://192.168.0.2:3000');
QUESTION
I have a frontend application(VUE JS)
I have a backend (Nest JS)
Vue JS app get data from backend via websockets using vue-socket.io-extended library When Vue JS app starts I see errors in browser:
polling-xhr.js?d33e:229 POST http://localhost:11050/socket.io/?EIO=4&transport=polling&t=NMXgCF1 400 (Bad Request)
How can I fix this error?
I think it is not connected with library, I tried just socket io library and the result was the same.
Server is working, because it sends logs and show who is connected:
Server(Nest JS) main.ts file:
...ANSWER
Answered 2020-Nov-12 at 20:24I ran into this issue today using a very similar NestJS implementation, however my frontend is written with ReactJS. I believe the issue is related to mismatched socket.io server and client versions.
I resolved this issue by downgrading the version of socket.io-client
from ^3.0.0
down to ^2.3.0
.
QUESTION
In main.js, from vue project app, I am setting a socket io url using the return of an API.
...ANSWER
Answered 2020-Jul-29 at 13:49Hello you should try something like :
QUESTION
I want to use my main vuejs instance to manage sockets.io connection and events. I have this code that works, but I have some problems to pass events from component to parent instance. The code is inside a chrome extension that use vuex, but I'm not familiar with vuex at the moment. How I can pass events between my main instance and child component? Someone has suggested me to use vuex, but it's divided in three files and I'm not able to understand for now how to obtain what I want.
...ANSWER
Answered 2020-May-08 at 17:07So, you can try vuex but it seems kind of heavy if all you want is a basic event listener. One option might be to go with the eventBus route and set up an emitter and a listener event. in main.js you can add
QUESTION
I am using vue socket io for getting data from socket. For getting data I use query like
...ANSWER
Answered 2020-Jan-21 at 01:40From Vue.use(plugin):
This method has to be called before calling new Vue()
So you have to register the plugin first then open the connection after when you ready. This question is already answered in FAQ section from the vue-socket.io-extended
How to prevent connection until authed?.
Basically you have to tell socket.io
to not open the connection at instantiate by set autoConnect
to false
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vue-socket.io-extended
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page