MCPcopy Index your code
hub / github.com/learning-zone/nodejs-basics / connected

Function connected

nodejs-basics/tls.js:15–22  ·  view source on GitHub ↗
(stream)

Source from the content-addressed store, hash-verified

13const tls = require('tls');
14
15function connected(stream) {
16 if (stream) {
17 // socket connected
18 stream.write("GET / HTTP/1.0\n\rHost: encrypted.google.com:443\n\r\n\r");
19 } else {
20 console.log("Connection failed!");
21 }
22}
23 // needed to keep socket variable in scope
24var dummy = this;
25 // try to connect to the server

Callers 1

tls.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected