Skip to content

Instantly share code, notes, and snippets.

@anthumchris
anthumchris / httpsSocketRequest.js
Last active June 23, 2025 04:35
HTTPS request with NodeJS TLS Socket
#!/usr/bin/env node
import tls from 'node:tls'
const host = 'one.one.one.one' // Cloudflare DNS
const port = 443
const timeout = 5_000
const path = '/dns/'
const request = trim(`