MCPcopy
hub / github.com/caddyserver/caddy / protocol

Method protocol

modules/caddyhttp/server.go:915–927  ·  view source on GitHub ↗

protocol returns true if the protocol proto is configured/enabled.

(proto string)

Source from the content-addressed store, hash-verified

913
914// protocol returns true if the protocol proto is configured/enabled.
915func (s *Server) protocol(proto string) bool {
916 if s.ListenProtocols == nil {
917 return slices.Contains(s.protocolsWithDefaults(), proto)
918 }
919
920 for _, lnProtocols := range s.ListenProtocols {
921 if slices.Contains(s.listenerProtocolsWithDefaults(lnProtocols), proto) {
922 return true
923 }
924 }
925
926 return false
927}
928
929func (s *Server) protocolsWithDefaults() []string {
930 if len(s.Protocols) == 0 {

Callers 2

httpsRRALPNsFunction · 0.80
StartMethod · 0.80

Calls 2

protocolsWithDefaultsMethod · 0.95

Tested by

no test coverage detected