mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-10-31 02:27:19 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			480 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			480 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package bind
 | |
| 
 | |
| import (
 | |
| 	"github.com/mholt/caddy"
 | |
| 	"github.com/mholt/caddy/caddyhttp/httpserver"
 | |
| )
 | |
| 
 | |
| func init() {
 | |
| 	caddy.RegisterPlugin("bind", caddy.Plugin{
 | |
| 		ServerType: "http",
 | |
| 		Action:     setupBind,
 | |
| 	})
 | |
| }
 | |
| 
 | |
| func setupBind(c *caddy.Controller) error {
 | |
| 	config := httpserver.GetConfig(c.Key)
 | |
| 	for c.Next() {
 | |
| 		if !c.Args(&config.ListenHost) {
 | |
| 			return c.ArgErr()
 | |
| 		}
 | |
| 		config.TLS.ListenHost = config.ListenHost // necessary for ACME challenges, see issue #309
 | |
| 	}
 | |
| 	return nil
 | |
| }
 |