mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-31 18:23:13 -04:00 
			
		
		
		
	* DoH: put in pkg/doh Factor out the DoH stuff into its own package, add function to request a DoH response. This can be used by forward (and maybe proxy) to implement DoH client support. Signed-off-by: Miek Gieben <miek@miek.nl> * lint Signed-off-by: Miek Gieben <miek@miek.nl> * ... and make it compile Signed-off-by: Miek Gieben <miek@miek.nl>
		
			
				
	
	
		
			24 lines
		
	
	
		
			582 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			582 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package dnsserver
 | |
| 
 | |
| import (
 | |
| 	"net"
 | |
| 
 | |
| 	"github.com/coredns/coredns/plugin/pkg/nonwriter"
 | |
| )
 | |
| 
 | |
| // DoHWriter is a nonwriter.Writer that adds more specific LocalAddr and RemoteAddr methods.
 | |
| type DoHWriter struct {
 | |
| 	nonwriter.Writer
 | |
| 
 | |
| 	// raddr is the remote's address. This can be optionally set.
 | |
| 	raddr net.Addr
 | |
| 	// laddr is our address. This can be optionally set.
 | |
| 	laddr net.Addr
 | |
| }
 | |
| 
 | |
| // RemoteAddr returns the remote address.
 | |
| func (d *DoHWriter) RemoteAddr() net.Addr { return d.raddr }
 | |
| 
 | |
| // LocalAddr returns the local address.
 | |
| func (d *DoHWriter) LocalAddr() net.Addr { return d.laddr }
 |