Update Upgrade.js

This commit is contained in:
uNetworkingAB
2023-01-15 19:47:40 +01:00
committed by GitHub
parent 124c70dd7d
commit 4774d92424

4
examples/Upgrade.js vendored
View File

@@ -18,7 +18,7 @@ const app = uWS./*SSL*/App({
/* This immediately calls open handler, you must not use res after this call */
res.upgrade({
url: req.getUrl()
myData: req.getUrl() /* First argument is UserData (see WebSocket.getUserData()) */
},
/* Spell these correctly */
req.getHeader('sec-websocket-key'),
@@ -28,7 +28,7 @@ const app = uWS./*SSL*/App({
},
open: (ws) => {
console.log('A WebSocket connected with URL: ' + ws.url);
console.log('A WebSocket connected with URL: ' + ws.myData);
},
message: (ws, message, isBinary) => {
/* Ok is false if backpressure was built up, wait for drain */