Skip to content

Commit 4774d92

Browse files
Update Upgrade.js
1 parent 124c70d commit 4774d92

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎examples/Upgrade.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const app = uWS./*SSL*/App({
1818

1919
/* This immediately calls open handler, you must not use res after this call */
2020
res.upgrade({
21-
url: req.getUrl()
21+
myData: req.getUrl() /* First argument is UserData (see WebSocket.getUserData()) */
2222
},
2323
/* Spell these correctly */
2424
req.getHeader('sec-websocket-key'),
@@ -28,7 +28,7 @@ const app = uWS./*SSL*/App({
2828

2929
},
3030
open: (ws) => {
31-
console.log('A WebSocket connected with URL: ' + ws.url);
31+
console.log('A WebSocket connected with URL: ' + ws.myData);
3232
},
3333
message: (ws, message, isBinary) => {
3434
/* Ok is false if backpressure was built up, wait for drain */

0 commit comments

Comments
 (0)