
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@thallo/api-websocket
Advanced tools
> 前端连接阿里 API 网关 websocket 的 SDK【TypeScript 版】。 > > 处理网关响应的各种信令,已集成重连机制,可自动重连,支持手动重连。
前端连接阿里 API 网关 websocket 的 SDK【TypeScript 版】。
处理网关响应的各种信令,已集成重连机制,可自动重连,支持手动重连。
依赖@thallo/api-signature
yarn add @thallo/api-websocket @thallo/api-signature
import WebsocketApiClient from "@thallo/api-websocket";
import ApiSignature from "@thallo/api-signature";
const Signature = new ApiSignature({
appKey: "test",
appSecret: "test",
stage: "RELEASE",
});
const socket = new WebsocketApiClient({
host: "www.test.com", // 域名
appKey: "test", // app key
Signature, // 签名实例
registerMethod: "POST", // 注册请求方法
registerPath: "/register", // 注册路由
logoutMethod: "POST", // 注销请求方法
logoutPath: "/logout", // 注销路由
});
// 设置注册参数,参数可选
// socket.setRegisterOptions({
// headers:{
// "x-token":"XXXXXXXXX"
// }
// params:{
// id:"xxxxxxxx"
// },
// data:{
// password:"xxxxxxxxxx"
// }
// })
// 设置注销参数,参数可选,若不设置默认与注册参数相同
// socket.setLogoutOptions({
// headers:{
// "x-token":"XXXXXXXXX"
// }
// params:{
// id:"xxxxxxxx"
// },
// data:{
// password:"xxxxxxxxxx"
// }
// })
// 主动连接websocket,默认不连接
socket.connect();
// 监听下发通知
socket.onNotify = (message: string) => {
// do something
};
// 注销
socket.logout();
FAQs
> 前端连接阿里 API 网关 websocket 的 SDK【TypeScript 版】。 > > 处理网关响应的各种信令,已集成重连机制,可自动重连,支持手动重连。
We found that @thallo/api-websocket demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.