-
|
I hope someone can help me to create a reusable function for HTTPS entries. My HTTPS entries consist of 3 DNS records (A, AAAA and HTTPS). The plain code looks like this: What I came up with to make this easier to read and maintain: This doesn't work, but as I don't know any javascript I have no clue why. Is what I'm trying to do even possible? |
Beta Was this translation helpful? Give feedback.
Answered by
cafferata
Dec 7, 2025
Replies: 1 comment 1 reply
-
|
@dimejo you're on the right track! See the working code example below: var HOST1_A = "192.168.1.1"
var HOST1_AAAA = "2001:0DB8::1"
var HOST2_A = "192.168.1.2"
var HOST2_AAAA = "2001:0DB8::2"
var FUN_HTTPS = function(name, ipv4, ipv6) {
return [
A(name, ipv4),
AAAA(name, ipv6),
HTTPS(name, 1, '.', 'alpn=h3,h2 ipv4hint=' + ipv4 + ' ipv6hint=' + ipv6),
];
};
D("example.com", REG_NONE,
FUN_HTTPS("alpha", HOST1_A, HOST1_AAAA),
FUN_HTTPS("beta", HOST2_A, HOST2_AAAA),
FUN_HTTPS("gamma", HOST2_A, HOST2_AAAA),
); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
dimejo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@dimejo you're on the right track! See the working code example below: