
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
hw-socket-sdk
Advanced tools
npm install hw-socket-sdk
import { SocketSDK } from 'hw-socket-sdk';
const client = SocketSDK.getInstance('ws://localhost:8081');
client.on(MessageActionType.LISTEN_FORCE_STOP, (data) => {
console.log('监听被强制停止', data);
});
client.on(MessageActionType.KICKED_OUT, (data) => {
console.log('被强制踢出', data);
});
client.on(MessageActionType.CUSTOM_MESSAGE, (data) => {
console.log('收到自定义消息', data);
});
client.on(MessageActionType.OPEN, () => {
console.log('连接已打开');
});
或者
client.onListenForceStop((data) => {
console.log('监听被强制停止', data);
});
client.onKickedOut((data) => {
console.log('被强制踢出', data);
});
client.onCustomMessage((data) => {
console.log('收到自定义消息', data);
});
client.onOpen(() => {
console.log('连接已打开');
});
// 当所有消息都没有匹配的监听器时,会触发此事件
client.onMessage(() => {
console.log('收到未注册的消息');
});
client.startListenDataChannel('data1:plain', (data) => {
console.log('收到数据流【data1:plain】的数据:', data);
});
client.stopListenDataChannel('data1:plain');
client.getListenDataChannelMap().forEach((value, key) => {
console.log('频道标识:', key, '监听函数:', value);
});
// 以心跳包为例,这是一个底层协议遵循的规范,调用SDK方法是,SDK会遵循此规则自动发送消息,一般不需要手动发送,除非忍不住。
this.send(
MessageActionType.PING,
null, // 这里统一写null,预留的
{
time: new Date().getTime()
}
);
FAQs
Huawang Socket SDK
The npm package hw-socket-sdk receives a total of 1 weekly downloads. As such, hw-socket-sdk popularity was classified as not popular.
We found that hw-socket-sdk 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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.