Compare View
Commits (2)
Changes
Showing 4 changed files Side-by-side Diff
CHANGELOG.md
... | ... | @@ -4,8 +4,14 @@ All notable changes to this project will be documented in this file. Dates are d |
4 | 4 | |
5 | 5 | Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). |
6 | 6 | |
7 | +#### [v0.1.9](https://gitlab.kodesumber.com/komodo/komodo-sdk-push-trx/compare/v0.1.8...v0.1.9) | |
8 | + | |
9 | +- Rename clientName to apikeyName [`5c5cf22`](https://gitlab.kodesumber.com/komodo/komodo-sdk-push-trx/commit/5c5cf22955ee66f1e60f9421f1b5355ae1b0cbbd) | |
10 | + | |
7 | 11 | #### [v0.1.8](https://gitlab.kodesumber.com/komodo/komodo-sdk-push-trx/compare/v0.1.7...v0.1.8) |
8 | 12 | |
13 | +> 7 February 2022 | |
14 | + | |
9 | 15 | - Add clientName on connected client [`0b6da0f`](https://gitlab.kodesumber.com/komodo/komodo-sdk-push-trx/commit/0b6da0fdd1a0fd2379024c3a9ee177c923faa5d9) |
10 | 16 | |
11 | 17 | #### [v0.1.7](https://gitlab.kodesumber.com/komodo/komodo-sdk-push-trx/compare/v0.1.6...v0.1.7) |
package-lock.json
1 | 1 | { |
2 | 2 | "name": "komodo-sdk-push-trx", |
3 | - "version": "0.1.8", | |
3 | + "version": "0.1.9", | |
4 | 4 | "lockfileVersion": 2, |
5 | 5 | "requires": true, |
6 | 6 | "packages": { |
7 | 7 | "": { |
8 | 8 | "name": "komodo-sdk-push-trx", |
9 | - "version": "0.1.8", | |
9 | + "version": "0.1.9", | |
10 | 10 | "license": "ISC", |
11 | 11 | "dependencies": { |
12 | 12 | "express": "^4.17.2", |
package.json
server.js
... | ... | @@ -46,12 +46,12 @@ if (!wsListenPort) { |
46 | 46 | // eslint-disable-next-line no-param-reassign |
47 | 47 | ws.isAlive = true; |
48 | 48 | |
49 | - const { remoteAddress, apikey, name: clientName } = client; | |
49 | + const { remoteAddress, apikey, apikeyName } = client; | |
50 | 50 | |
51 | 51 | logger.info(`${MODULE_NAME} F7755A03: Client connected`, { |
52 | 52 | xid: connectionXid, |
53 | 53 | remoteAddress, |
54 | - clientName, | |
54 | + apikeyName, | |
55 | 55 | apikey, |
56 | 56 | }); |
57 | 57 | |
... | ... | @@ -175,17 +175,18 @@ if (!wsListenPort) { |
175 | 175 | return; |
176 | 176 | } |
177 | 177 | |
178 | - logger.verbose(`${MODULE_NAME} AB8BC2F4: Incoming HTTP connection`, { | |
179 | - headers: req.headers, | |
180 | - }); | |
181 | - | |
182 | 178 | wss.handleUpgrade(req, socket, head, (ws) => { |
183 | 179 | const client = { |
184 | 180 | remoteAddress: req.socket.remoteAddress, |
181 | + apikeyName: matchedApikey.name, | |
185 | 182 | apikey, |
186 | - name: matchedApikey.name, | |
187 | 183 | }; |
188 | 184 | |
185 | + logger.verbose(`${MODULE_NAME} AB8BC2F4: Incoming HTTP connection`, { | |
186 | + headers: req.headers, | |
187 | + client, | |
188 | + }); | |
189 | + | |
189 | 190 | wss.emit('connection', ws, req, client); |
190 | 191 | }); |
191 | 192 | }); |