You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this needs to be split up, and wrapped in Promise to make the example more understandable.
It'll work, but is a bit too simple for node-test-snippets
'use strict';constWebSocket=require('ws');constserver=newWebSocket.Server({port: 0},function(){// client wrapped by serverconstclient=newWebSocket(`ws://localhost:${server.address().port}`,{headers: {Cookie: 'yummy_cookie=choco'}});client.on('close',function(){server.close();});});server.on('connection',function(websocket,request){console.log(request.headers.cookie);websocket.close();});
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I think this needs to be split up, and wrapped in
Promise
to make the example more understandable.It'll work, but is a bit too simple for node-test-snippets
Source: websockets#2027 (comment)
Beta Was this translation helpful? Give feedback.
All reactions