@eleven-am/pondsocket 0.1.27 → 0.1.29

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.
package/client.js CHANGED
@@ -75,7 +75,7 @@ class PondClient {
75
75
  _createPublisher() {
76
76
  return (message) => {
77
77
  var _a;
78
- if (((_a = this._socket) === null || _a === void 0 ? void 0 : _a.readyState) === WebSocket.OPEN) {
78
+ if (((_a = this._socket) === null || _a === void 0 ? void 0 : _a.readyState) === 1) {
79
79
  this._socket.send(JSON.stringify(message));
80
80
  }
81
81
  };
package/node.js CHANGED
@@ -3,14 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const ws_1 = require("ws");
7
6
  const client_1 = __importDefault(require("./client"));
7
+ const WebSocket = require('websocket').w3cwebsocket;
8
8
  class PondClient extends client_1.default {
9
9
  /**
10
10
  * @desc Connects to the server and returns the socket.
11
11
  */
12
12
  connect(backoff = 1) {
13
- const socket = new ws_1.WebSocket(this._address.toString());
13
+ const socket = new WebSocket(this._address.toString());
14
14
  socket.onopen = () => {
15
15
  this._connectionState.publish('OPEN');
16
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eleven-am/pondsocket",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
4
4
  "description": "PondSocket is a fast simple socket server",
5
5
  "keywords": [
6
6
  "socket",
@@ -28,12 +28,14 @@
28
28
  "url": "git+https://github.com/Eleven-am/pondSocket.git"
29
29
  },
30
30
  "dependencies": {
31
+ "websocket": "^1.0.34",
31
32
  "ws": "^8.12.0"
32
33
  },
33
34
  "devDependencies": {
34
35
  "@types/express": "^4.17.14",
35
36
  "@types/jest": "^29.5.0",
36
37
  "@types/node": "^16.10.3",
38
+ "@types/websocket": "^1.0.5",
37
39
  "@types/ws": "^8.5.3",
38
40
  "@typescript-eslint/eslint-plugin": "^5.58.0",
39
41
  "eslint": "^8.38.0",
package/tsconfig.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2015",
4
+ "module": "commonjs",
5
+ "declaration": false,
6
+ "outDir": "./dist",
7
+ "esModuleInterop": true,
8
+ "strict": true,
9
+ },
10
+ "include": ["src"],
11
+ "exclude": ["node_modules", "**/__tests__/*"]
12
+ }
File without changes