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
varfs=require('fs');vartls=require('tls');varnet=require('net');varhttp=require('http');if('server'==process.argv[2]){varhttpServer=http.createServer(function(request,response){response.end('Waiting for a client');});httpServer.on('upgrade',function(request,socket,head){socket.write('HTTP/1.1 101 Web Socket Protocol Handshake\r\n'+'Upgrade: websocket\r\n'+'Connection: Upgrade\r\n'+'\r\n');newtls.TLSSocket(socket);console.log('>>> OK <<<');});varserver=net.createServer();server.on('connection',function(connection){httpServer.emit('connection',connection);});server.listen('5000');}else{varrequest=http.request({host: 'localhost',port: '5000',headers: {'Connection': 'Upgrade','Upgrade': 'websocket'}});request.end();}
Script:
Core Dump:
The text was updated successfully, but these errors were encountered: