There was an error while loading. Please reload this page.
1 parent 124c70d commit 4774d92Copy full SHA for 4774d92
1 file changed
examples/Upgrade.js
@@ -18,7 +18,7 @@ const app = uWS./*SSL*/App({
18
19
/* This immediately calls open handler, you must not use res after this call */
20
res.upgrade({
21
- url: req.getUrl()
+ myData: req.getUrl() /* First argument is UserData (see WebSocket.getUserData()) */
22
},
23
/* Spell these correctly */
24
req.getHeader('sec-websocket-key'),
@@ -28,7 +28,7 @@ const app = uWS./*SSL*/App({
28
29
30
open: (ws) => {
31
- console.log('A WebSocket connected with URL: ' + ws.url);
+ console.log('A WebSocket connected with URL: ' + ws.myData);
32
33
message: (ws, message, isBinary) => {
34
/* Ok is false if backpressure was built up, wait for drain */
0 commit comments