New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@vanwei-wcs/wwav-io

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vanwei-wcs/wwav-io

wwav io

latest
npmnpm
Version
1.0.6
Version published
Maintainers
1
Created
Source

wwav-io

创建 wwav地址的 请求

安装

npm i @vanwei-wcs/wwav-io

使用

import WWAVIO from '@vanwei-wcs/wwav-io'

const url = 'ws://192.168.8.120:3094/mts/wwav/W867651902yzwfQzpCcNPUd283Gjs.wwav'
const token = 'c70mxehw'

const io = new WWAVIO(url,token)

组件api

属性

参数说明类型
ws原始websocket实例,只读WebSocket
url连接地址,只读string
binaryType等于websocket属性binaryType ,读写string
readyState等价于websocket属性readyState,只读number

方法

方法说明参数
send等价于 websocket send()message
close等价于 websocket close()(code,reason)
on监听事件(event,listener)
off取消监听事件(event,listener)

事件

事件说明参数
openwebsocket 已打开event
closewebsocket 已关闭event
messagewebsocket 消息event
errorwebsocket 错误event
authentication认证结果,authentication为 true 表示认证成功{authentication,code,message}
stream接收到的私有码流,Uint8Array类型buffer

demo

try {
	io = new WWAVIO(url, token);
} catch (error) {
	console.log("error", error);
}

console.log("io", io);
io.on("open", function (e) {
	console.log("connect success", e);
});
io.on("close", function (e) {
	console.log("connect close", e);
});
io.on("error ", function (e) {
	console.log("connect error", e, e.code, e.message);
});
io.on("authentication", (e) => {
	console.log("e", e);
});
io.on("stream", (buffer) => {
	console.log("buffer");
});

Keywords

wwav-io

FAQs

Package last updated on 07 Apr 2022

Did you know?

Socket

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.

Install

Related posts