Skip to content

Commit f0aea7c

Browse files
Enable proxy for Cloudflare tunnel CNAME records (#14)
This commit checks if the record is a CNAME that ends with `.cfargotunnel.com` and if so, it will enable Cloudflare proxying for that record. Note that a `cfargotunnel.com` record that does not have proxying enabled cannot work ever, so there's no reason to ever not do this.
1 parent 7e5687a commit f0aea7c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

models.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ func cloudflareRecord(r libdns.Record) (cfDNSRecord, error) {
167167
rec.Data.Priority = r.Priority
168168
rec.Content = r.Value
169169
}
170+
if rec.Type == "CNAME" && strings.HasSuffix(rec.Content, ".cfargotunnel.com") {
171+
rec.Proxied = true
172+
}
170173
return rec, nil
171174
}
172175

0 commit comments

Comments
 (0)