插座
通过WebSockets通信的库
安装
npm install ag-sockets
npm install ws # peer dependency
用法
与使用
npm install uws
import * as uws from 'uws' ;
import { createServer } from 'ag-sockets' ;
// ...
const wsServer = createServer ( ... , { ws : uws , arrayBuffer : true } ) ;
设置插座
通用接口
// interfaces.ts
import { SocketClient , SocketServer } from 'ag-sockets' ;
export interface IExampleClient extends SocketClient {
1