Skip to content

Instantly share code, notes, and snippets.

@prajaybasu
prajaybasu / doh.uc
Created April 25, 2025 00:17
DoH proxy for OpenWRT and uhttpd-mod-ucode
#!/usr/bin/env ucode
import { fdopen } from "fs";
import { create, AF_INET6, SOCK_DGRAM, SOL_SOCKET, SO_RCVTIMEO } from "socket";
const MAXLEN = 4096;
const TIMEOUT = 10000;
function b64url_decode(s) {
if (!s) return null;
s = replace(s, "-", "+");