Using the tls module
Creating a Connection
Example GET Request with TLS
import { net } from 'thousandeyes';
runScript();
async function runScript() {
let host = 'google.com';
let port = 443;
let request_body = `GET / HTTP/1.1\r\n` +
`Host: ${host}\r\n` +
`User-Agent: thousandeyes-transaction\r\n` +
`\r\n`;
let client = await net.connectTls(port, host);
client.setEncoding('utf8');
await client.write(request_body);
await client.end();
let response = await client.read();
console.log(response);
};Last updated