Gathering detailed insights and metrics for vue-websocket
Gathering detailed insights and metrics for vue-websocket
Gathering detailed insights and metrics for vue-websocket
Gathering detailed insights and metrics for vue-websocket
vue-native-websocket
native websocket implemantation for vuejs and vuex
vue-socket.io
socket.io implementation for Vue.js and Vuex
vue-native-websocket-vue3
支持vue3和vuex、pinia的websocket插件
@tencentcloud/chat-uikit-vue
Build In-App Chat & Audio/Video Call & Live Streaming in minutes with UIKit components for Vue.
npm install vue-websocket
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
528 Stars
34 Commits
75 Forks
27 Watchers
1 Branches
3 Contributors
Updated on Apr 25, 2025
Latest Version
0.2.3
Package Id
vue-websocket@0.2.3
Unpacked Size
562.01 kB
Size
148.98 kB
File Count
6
NPM Version
5.6.0
Node Version
8.11.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
40
A socket.io plugin for Vue.js.
This package does not support native websockets. At the time, we recommend using vue-native-websocket or implementing it yourself. For ongoing discussion on this, please visit #2.
You can either install this package with npm
, or manually by downloading the primary plugin file.
1$ npm install -S vue-websocket
Download the production vue-websocket.js
file. This link is a mirror of the same file found in the dist
directory of this project.
Register the plugin. By default, it will connect to /
:
1import VueWebsocket from "vue-websocket"; 2Vue.use(VueWebsocket);
Or to connect to another address:
1Vue.use(VueWebsocket, "ws://otherserver:8080");
You can also pass options:
1Vue.use(VueWebsocket, "ws://otherserver:8080", { 2 reconnection: false 3});
To use it in your components:
1<script> 2 export default { 3 4 methods: { 5 add() { 6 // Emit the server side 7 this.$socket.emit("add", { a: 5, b: 3 }); 8 }, 9 10 get() { 11 this.$socket.emit("get", { id: 12 }, (response) => { 12 ... 13 }); 14 } 15 }, 16 17 socket: { 18 // Prefix for event names 19 // prefix: "/counter/", 20 21 // If you set `namespace`, it will create a new socket connection to the namespace instead of `/` 22 // namespace: "/counter", 23 24 events: { 25 26 // Similar as this.$socket.on("changed", (msg) => { ... }); 27 // If you set `prefix` to `/counter/`, the event name will be `/counter/changed` 28 // 29 changed(msg) { 30 console.log("Something changed: " + msg); 31 } 32 33 /* common socket.io events 34 connect() { 35 console.log("Websocket connected to " + this.$socket.nsp); 36 }, 37 38 disconnect() { 39 console.log("Websocket disconnected from " + this.$socket.nsp); 40 }, 41 42 error(err) { 43 console.error("Websocket error!", err); 44 } 45 */ 46 47 } 48 } 49 }; 50 51</script>
This command will build a distributable version in the dist
directory:
1$ npm run build
This package uses karma
for testing. You can run the tests like so:
1$ npm test
Please send pull requests improving the usage and fixing bugs, improving documentation and providing better examples, or providing some testing, because these things are important.
vue-websocket
is available under the MIT license.
Copyright © 2018 Icebob
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
project is archived
Details
Reason
Found 1/26 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
126 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More