![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
node-socket-rpc
Advanced tools
使用 nodejs 开发的 socket 通讯,目前支持 tcp 协议。基本功能:断线重连、心跳检测、路由、远程调用、超时监听等。
支持客户端监听服务端的通知、事件。使用路由方式在客户端监听。
支持远程调用。服务端注册方法,客户端调用方法即可。
可以查看test
目录下的文件
import NClient from "../src/NClient";
const ct = new NClient();
ct.listen(18000);
const sleep = (time: number) => new Promise((resolve) => setTimeout(() => resolve(), time));
ct.use("test", async function (data) {
console.log("1", data);
await sleep(3000);
console.log("1_end");
return data + 1;
});
ct.use("test", async function (data) {
console.log("2", data);
await sleep(2000);
console.log("2_end");
return data + 1;
});
cfg
。服务端的配置,保存了使用到的配置内容。listen(port = 4000, host?: string)
。启动服务端的监听,传入监听的端口,可选的 hostname。notice(uid: string, group: string, data: any)
。主动通知除 uid 之外该房间的所有人。sendTo(uid: string, command: string, data?: any)
。给 uid 对应的客户端发送消息。sendAll(command: string, data?: any)
。给所有人发送消息cfg
。配置信息。info
。当前状态信息listen(port = 3000, host?: string)
。启动监听服务。retry
。重新连接服务端。send(command, data, group?)
。发送消息。sendGroup(data:any)
。给房间群组发送消息。setGroup(group: string)
。设置房间/群组的名称onNotice(fn: any)
。当收到群体通知的时候。use(routeName:string, fn:any)
。路由事件。call(method: string)
。远程调用方法FAQs
使用nodejs开发的socket通讯RPC
We found that node-socket-rpc 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.