Class: Baykit::BayServer::Docker::Http::HtpPortDocker

Inherits:
Base::PortBase
  • Object
show all
Includes:
Bcf, Base, Baykit::BayServer::Docker::Http, H1, H2, HtpDocker, Protocol, Util
Defined in:
lib/baykit/bayserver/docker/http/htp_port_docker.rb

Constant Summary collapse

DEFAULT_SUPPORT_H2 =
true

Constants included from HtpDocker

Baykit::BayServer::Docker::Http::HtpDocker::H1_PROTO_NAME, Baykit::BayServer::Docker::Http::HtpDocker::H2_PROTO_NAME

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHtpPortDocker

Returns a new instance of HtpPortDocker.



29
30
31
32
# File 'lib/baykit/bayserver/docker/http/htp_port_docker.rb', line 29

def initialize
  super
  @support_h2 = DEFAULT_SUPPORT_H2
end

Instance Attribute Details

#support_h2Object (readonly)

Returns the value of attribute support_h2.



27
28
29
# File 'lib/baykit/bayserver/docker/http/htp_port_docker.rb', line 27

def support_h2
  @support_h2
end

Instance Method Details

#init(elm, parent) ⇒ Object

Implements Docker



38
39
40
41
42
43
44
45
46
47
# File 'lib/baykit/bayserver/docker/http/htp_port_docker.rb', line 38

def init(elm, parent)
  super

  if @support_h2
    if @secure_docker != nil
      @secure_docker.set_app_protocols(["h2", "http/1.1"])
    end
    H2ErrorCode.init()
  end
end

#init_key_val(kv) ⇒ Object

Implements DockerBase



53
54
55
56
57
58
59
60
61
# File 'lib/baykit/bayserver/docker/http/htp_port_docker.rb', line 53

def init_key_val(kv)
  case kv.key.downcase
  when "supporth2", "enableh2"
    @support_h2 = StringUtil.parse_bool(kv.value)
  else
    return super
  end
  return true
end

#protocolObject

Implements Port



67
68
69
# File 'lib/baykit/bayserver/docker/http/htp_port_docker.rb', line 67

def protocol()
  return H1_PROTO_NAME
end

#support_anchoredObject

Implements PortBase



74
75
76
# File 'lib/baykit/bayserver/docker/http/htp_port_docker.rb', line 74

def support_anchored()
  return true
end

#support_unanchoredObject



78
79
80
# File 'lib/baykit/bayserver/docker/http/htp_port_docker.rb', line 78

def support_unanchored()
  return false
end