diff --git a/package.json b/package.json index 50ff3d4..554018b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ycs-plugin-mosca", - "version": "1.0.2", + "version": "1.0.3", "description": "ycs-plugin-mosca", "license": "MIT", "repository": "https://github.com/yc-server/ycs-plugin-mosca.git", @@ -36,7 +36,8 @@ "devDependencies": { "@types/jest": "^20.0.5", "@types/node": "^8.0.0", - "@ycs/core": "^0.1.12", + "@types/socket.io": "^1.4.33", + "@ycs/core": "^1.0.5", "colors": "^1.1.2", "coveralls": "^2.0.0", "jest": "^20.0.4", diff --git a/src/setup.ts b/src/setup.ts index 2d68307..c8a35c2 100644 --- a/src/setup.ts +++ b/src/setup.ts @@ -1,4 +1,5 @@ import { Ycs } from '@ycs/core'; +import { preListenActions } from '@ycs/core/lib/http'; import { Router } from '@ycs/core/lib/routers'; import * as colors from 'colors/safe'; import * as koa from 'koa'; @@ -38,6 +39,9 @@ function setupMosca(app: Ycs, config: IConfig) { new koa().use(serve(path.dirname(require.resolve('mosca')) + '/public')) ) ); + preListenActions.push(httpServer => { + serve.attachHttpServer(httpServer); + }); } else { server = new mosca.Server({ port: config.port,