@eleven-am/pondsocket 0.1.174 → 0.1.176
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/package.json +2 -2
- package/server/server.js +12 -2
- package/wrappers/channel.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eleven-am/pondsocket",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.176",
|
|
4
4
|
"description": "PondSocket is a fast simple socket server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"socket",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"url": "git+https://github.com/Eleven-am/pondSocket.git"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@eleven-am/pondsocket-common": "^0.0.
|
|
37
|
+
"@eleven-am/pondsocket-common": "^0.0.25",
|
|
38
38
|
"ioredis": "^5.4.1",
|
|
39
39
|
"ws": "^8.18.0"
|
|
40
40
|
},
|
package/server/server.js
CHANGED
|
@@ -19,7 +19,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
19
19
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
20
20
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
21
21
|
};
|
|
22
|
-
var _PondSocket_instances, _PondSocket_server, _PondSocket_socketServer, _PondSocket_redisClient, _PondSocket_middleware, _PondSocket_manageHeartbeat, _PondSocket_init;
|
|
22
|
+
var _PondSocket_instances, _PondSocket_server, _PondSocket_socketServer, _PondSocket_redisClient, _PondSocket_middleware, _PondSocket_manageHeartbeat, _PondSocket_init, _PondSocket_getCookies;
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
24
|
exports.PondSocket = void 0;
|
|
25
25
|
const http_1 = require("http");
|
|
@@ -62,7 +62,7 @@ class PondSocket {
|
|
|
62
62
|
__classPrivateFieldGet(this, _PondSocket_middleware, "f").use((req, params, next) => {
|
|
63
63
|
const event = (0, matcher_1.parseAddress)(path, req.address);
|
|
64
64
|
if (event) {
|
|
65
|
-
const request = Object.assign(Object.assign({}, event), { headers: req.headers, address: req.address, id: req.id });
|
|
65
|
+
const request = Object.assign(Object.assign({}, event), { cookies: __classPrivateFieldGet(this, _PondSocket_instances, "m", _PondSocket_getCookies).call(this, req.headers), headers: req.headers, address: req.address, id: req.id });
|
|
66
66
|
const newParams = {
|
|
67
67
|
params,
|
|
68
68
|
engine: endpoint,
|
|
@@ -125,4 +125,14 @@ _PondSocket_server = new WeakMap(), _PondSocket_socketServer = new WeakMap(), _P
|
|
|
125
125
|
socket.destroy();
|
|
126
126
|
});
|
|
127
127
|
});
|
|
128
|
+
}, _PondSocket_getCookies = function _PondSocket_getCookies(headers) {
|
|
129
|
+
const cookieHeader = headers.cookie;
|
|
130
|
+
if (!cookieHeader) {
|
|
131
|
+
return {};
|
|
132
|
+
}
|
|
133
|
+
return cookieHeader.split(';').reduce((cookies, cookie) => {
|
|
134
|
+
const [name, value] = cookie.trim().split('=');
|
|
135
|
+
cookies[name] = decodeURIComponent(value);
|
|
136
|
+
return cookies;
|
|
137
|
+
}, {});
|
|
128
138
|
};
|
package/wrappers/channel.js
CHANGED
|
@@ -22,7 +22,7 @@ class Channel {
|
|
|
22
22
|
getUserData(userId) {
|
|
23
23
|
return __classPrivateFieldGet(this, _Channel_engine, "f").getUser(userId);
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
getPresences() {
|
|
26
26
|
return __classPrivateFieldGet(this, _Channel_engine, "f").getPresence();
|
|
27
27
|
}
|
|
28
28
|
getAssigns() {
|