@eleven-am/pondsocket 0.1.83 → 0.1.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/nest.js +8 -6
  2. package/package.json +1 -1
package/nest.js CHANGED
@@ -21,6 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.PondSocketModule = exports.Endpoints = exports.Endpoint = exports.Channel = exports.ChannelInstance = exports.OnConnectionRequest = exports.OnEvent = exports.OnJoinRequest = exports.GetConnectionQuery = exports.GetConnectionHeaders = exports.GetConnectionParams = exports.GetConnectionRequestId = exports.GetConnectionResponse = exports.GetConnectionRequest = exports.GetEventRequest = exports.GetEventResponse = exports.GetEventQuery = exports.GetEventParams = exports.GetEventPayload = exports.GetUserPresences = exports.GetInternalChannel = exports.GetUserData = exports.GetJoinParams = exports.GetJoinResponse = exports.GetJoinRequest = void 0;
24
+ const http_1 = require("http");
24
25
  const common_1 = require("@nestjs/common");
25
26
  require("reflect-metadata");
26
27
  const pondSocket_1 = require("./server/pondSocket");
@@ -460,14 +461,15 @@ const Endpoints = ({ endpoints, providers = [], imports = [], exports = [], }) =
460
461
  exports.Endpoints = Endpoints;
461
462
  class PondSocketModule {
462
463
  constructor(moduleRef, adapterHost) {
464
+ var _a;
463
465
  this.moduleRef = moduleRef;
464
466
  this.adapterHost = adapterHost;
465
- const expressInstance = this.adapterHost.httpAdapter;
466
- const server = expressInstance.getHttpServer();
467
- const socket = new pondSocket_1.PondSocket(server);
468
- expressInstance.listen = (...args) => {
469
- var _a;
470
- const endpoints = (_a = getClassMetadata(endpointsClassKey, this.constructor)) !== null && _a !== void 0 ? _a : [];
467
+ const httpAdapter = this.adapterHost.httpAdapter;
468
+ const endpoints = (_a = getClassMetadata(endpointsClassKey, this.constructor)) !== null && _a !== void 0 ? _a : [];
469
+ httpAdapter.listen = (...args) => {
470
+ const app = httpAdapter.getInstance();
471
+ const server = (0, http_1.createServer)(app);
472
+ const socket = new pondSocket_1.PondSocket(server);
471
473
  endpoints.forEach((endpoint) => this.manageEndpoint(socket, endpoint));
472
474
  return socket.listen(...args);
473
475
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eleven-am/pondsocket",
3
- "version": "0.1.83",
3
+ "version": "0.1.84",
4
4
  "description": "PondSocket is a fast simple socket server",
5
5
  "keywords": [
6
6
  "socket",