mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-10-31 02:09:27 +08:00 
			
		
		
		
	core: Implement socket activation listeners (#6573)
* caddy adapt for listen_protocols * adapt listen_socket * allow multiple listen sockets for port ranges and readd socket fd listen logic * readd logic to start servers according to listener protocols * gofmt * adapt caddytest * gosec * fmt and rename listen to listenWithSocket * fmt and rename listen to listenWithSocket * more consistent error msg * non unix listenReusableWithSocketFile * remove unused func * doc comment typo * nonosec * commit * doc comments * more doc comments * comment was misleading, cardinality did not change * addressesWithProtocols * update test * fd/ and fdgram/ * rm addr * actually write... * i guess we doin' "skip": now * wrong var in placeholder * wrong var in placeholder II * update param name in comment * dont save nil file pointers * windows * key -> parsedKey * osx * multiple default_bind with protocols * check for h1 and h2 listener netw
This commit is contained in:
		| @ -660,6 +660,8 @@ func AdminAPIRequest(adminAddr, method, uri string, headers http.Header, body io | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		parsedAddr.Host = addr | ||||
| 	} else if parsedAddr.IsFdNetwork() { | ||||
| 		origin = "http://127.0.0.1" | ||||
| 	} | ||||
|  | ||||
| 	// form the request | ||||
| @ -667,13 +669,13 @@ func AdminAPIRequest(adminAddr, method, uri string, headers http.Header, body io | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("making request: %v", err) | ||||
| 	} | ||||
| 	if parsedAddr.IsUnixNetwork() { | ||||
| 	if parsedAddr.IsUnixNetwork() || parsedAddr.IsFdNetwork() { | ||||
| 		// We used to conform to RFC 2616 Section 14.26 which requires | ||||
| 		// an empty host header when there is no host, as is the case | ||||
| 		// with unix sockets. However, Go required a Host value so we | ||||
| 		// used a hack of a space character as the host (it would see | ||||
| 		// the Host was non-empty, then trim the space later). As of | ||||
| 		// Go 1.20.6 (July 2023), this hack no longer works. See: | ||||
| 		// with unix sockets and socket fds. However, Go required a | ||||
| 		// Host value so we used a hack of a space character as the host | ||||
| 		// (it would see the Host was non-empty, then trim the space later). | ||||
| 		// As of Go 1.20.6 (July 2023), this hack no longer works. See: | ||||
| 		// https://github.com/golang/go/issues/60374 | ||||
| 		// See also the discussion here: | ||||
| 		// https://github.com/golang/go/issues/61431 | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Aaron Paterson
					Aaron Paterson