
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
w-websocket-client
Advanced tools
A wrapper for websocket in nodejs and browser.
To view documentation or get support, visit docs.
Note:
w-websocket-client
is mainly dependent onws
npm i w-websocket-client
w-websocket-client
:Link: [dev source code]
import WSC from 'w-websocket-client/dist/w-websocket-client.umd.js'
let opt = {
url: 'ws://localhost:8080',
token: '*',
open: function() {
console.log('client nodejs: open')
//send
wsc.send('abc')
},
close: function() {
console.log('client nodejs: close')
},
message: function(data) {
console.log('client nodejs: message', data)
},
error: function(err) {
console.log('client nodejs: error:', err)
},
}
//WSC
let wsc = new WSC(opt)
Note:
w-websocket-client
does't depend on any package in browser.
[Optional] Add script with nomodule for IE11.
<script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill/dist/polyfill.min.js"></script>
[Necessary] Add script for w-websocket-client.
<script src="https://cdn.jsdelivr.net/npm/w-websocket-client@1.0.29/dist/w-websocket-client.umd.js"></script>
w-websocket-client
:Link: [dev source code]
//opt
let opt = {
url: 'ws://localhost:8080',
token: '*',
open: function() {
console.log('client web: open')
//send
wsc.send('abc')
},
close: function() {
console.log('client web: close')
},
message: function(data) {
console.log('client web: message', data)
},
error: function(err) {
console.log('client web: error:', err)
},
}
//WSC
let WSC = window['w-websocket-client']
let wsc = new WSC(opt)
FAQs
A wrapper for websocket in nodejs and browser.
The npm package w-websocket-client receives a total of 507 weekly downloads. As such, w-websocket-client popularity was classified as not popular.
We found that w-websocket-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.