lib/falcon/command/virtual.rb in falcon-0.33.10 vs lib/falcon/command/virtual.rb in falcon-0.33.11

- old
+ new

@@ -80,10 +80,11 @@ spawn(path, container, chdir: root) end hosts = Hosts.new(configuration) + hosts.run(container, **@options) return container end @@ -91,15 +92,25 @@ container = run(parent.verbose?) container.wait end - def insecure_endpoint - Async::HTTP::Endpoint.parse(@options[:bind_insecure]) + def insecure_endpoint(**options) + Async::HTTP::Endpoint.parse(@options[:bind_insecure], **options) end - def secure_endpoint - Async::HTTP::Endpoint.parse(@options[:bind_secure]) + def secure_endpoint(**options) + Async::HTTP::Endpoint.parse(@options[:bind_secure], **options) + end + + # An endpoint suitable for connecting to the specified hostname. + def host_endpoint(hostname, **options) + endpoint = secure_endpoint(**options) + + url = URI.parse(@options[:bind_secure]) + url.hostname = hostname + + return Async::HTTP::Endpoint.new(url, hostname: endpoint.hostname) end end end end