@gulibs/tegg-wss
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

TEGG wss Plugin

tegg的Websocket插件

NPM

安装

npm install --save @gulibs/tegg-wss

or

yarn add @gulibs/tegg-wss

使用和配置

  • config.default.ts
const config = {
    wss: {
      options: {
        noServer: true
        // host: '127.0.0.1',
        // port: 9100
      },
      namespace: {
        "/chat": {
          middleware: ['auth', 'chat']
        }
      }
    },
} as PowerPartial<EggAppConfig>;
  • plugin.ts
teggWebsocket: {
    enable: true,
    package: "@gulibs/tegg-wss"
}

中间件

创建/app/wss/middleware,然后在/app/wss/middleware目录创建中间件.ts文件.

/@gulibs/tegg-wss/

    Package Sidebar

    Install

    npm i @gulibs/tegg-wss

    Weekly Downloads

    0

    Version

    0.0.6

    License

    MIT

    Unpacked Size

    22.7 kB

    Total Files

    12

    Last publish

    Collaborators

    • gujiwen