Skip to content

Commit 6fd7349

Browse files
authored
Merge branch 'master' into docs-and-comments
2 parents f7225f1 + 1db3587 commit 6fd7349

File tree

4 files changed

+23
-17
lines changed

4 files changed

+23
-17
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ server.route({
281281
websocket: {
282282
only: true,
283283
autoping: 10 * 1000,
284-
subprotocol: "v1.foo.example.com",
284+
subprotocol: "quux.example.com",
285285
initially: true,
286286
connect: ({ ctx, wss, ws, req, peers }) => {
287287
...
@@ -358,7 +358,7 @@ should be your choice, of course.
358358
License
359359
-------
360360
361-
Copyright (c) 2016-2021 Dr. Ralf S. Engelschall (http://engelschall.com/)
361+
Copyright (c) 2016-2022 Dr. Ralf S. Engelschall (http://engelschall.com/)
362362
363363
Permission is hereby granted, free of charge, to any person obtaining
364364
a copy of this software and associated documentation files (the

eslint.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
##
22
## hapi-plugin-websocket -- HAPI plugin for seamless WebSocket integration
3-
## Copyright (c) 2016-2021 Dr. Ralf S. Engelschall <[email protected]>
3+
## Copyright (c) 2016-2022 Dr. Ralf S. Engelschall <[email protected]>
44
##
55
## Permission is hereby granted, free of charge, to any person obtaining
66
## a copy of this software and associated documentation files (the
@@ -29,13 +29,11 @@ extends:
2929
- eslint-config-standard
3030

3131
parserOptions:
32-
ecmaVersion: 8
32+
ecmaVersion: 12
3333
sourceType: module
3434
ecmaFeatures:
3535
jsx: false
3636

37-
parser: babel-eslint
38-
3937
env:
4038
browser: true
4139
node: false
@@ -63,4 +61,5 @@ rules:
6361
curly: off
6462
space-in-parens: off
6563
object-curly-newline: off
64+
object-shorthand: off
6665

hapi-plugin-websocket.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
** hapi-plugin-websocket -- HAPI plugin for seamless WebSocket integration
3-
** Copyright (c) 2016-2021 Dr. Ralf S. Engelschall <[email protected]>
3+
** Copyright (c) 2016-2022 Dr. Ralf S. Engelschall <[email protected]>
44
**
55
** Permission is hereby granted, free of charge, to any person obtaining
66
** a copy of this software and associated documentation files (the
@@ -371,8 +371,16 @@ const register = async (server, pluginOptions) => {
371371
/* make available to HAPI request the remote WebSocket information */
372372
server.ext({ type: "onRequest", method: (request, h) => {
373373
if (isRequestWebSocketDriven(request)) {
374-
request.info.remoteAddress = request.plugins.websocket.req.socket.remoteAddress
375-
request.info.remotePort = request.plugins.websocket.req.socket.remotePort
374+
/* RequestInfo's remoteAddress and remotePort use getters and are not
375+
settable, so we have to replace them. */
376+
Object.defineProperties(request.info, {
377+
remoteAddress: {
378+
value: request.plugins.websocket.req.socket.remoteAddress
379+
},
380+
remotePort: {
381+
value: request.plugins.websocket.req.socket.remotePort
382+
}
383+
});
376384
}
377385
return h.continue
378386
} })

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hapi-plugin-websocket",
3-
"version": "2.3.7",
3+
"version": "2.3.8",
44
"description": "HAPI plugin for seamless WebSocket integration",
55
"keywords": [ "hapi", "plugin", "websocket" ],
66
"main": "./hapi-plugin-websocket.js",
@@ -20,19 +20,18 @@
2020
"@hapi/hapi": ">=18.0.0"
2121
},
2222
"dependencies": {
23-
"urijs": "1.19.7",
23+
"urijs": "1.19.11",
2424
"@hapi/hoek": "9.2.1",
2525
"@hapi/boom": "9.1.4",
26-
"ws": "8.2.3",
26+
"ws": "8.5.0",
2727
"websocket-framed": "1.2.8"
2828
},
2929
"devDependencies": {
30-
"@hapi/hapi": "20.2.1",
30+
"@hapi/hapi": "20.2.2",
3131
"@hapi/basic": "6.0.0",
32-
"babel-eslint": "10.1.0",
33-
"eslint": "7.32.0",
34-
"eslint-config-standard": "16.0.3",
35-
"eslint-plugin-import": "2.25.2",
32+
"eslint": "8.13.0",
33+
"eslint-config-standard": "17.0.0",
34+
"eslint-plugin-import": "2.26.0",
3635
"eslint-plugin-node": "11.1.0"
3736
},
3837
"engines": {

0 commit comments

Comments
 (0)