Sha256: 92d3e5794848b8dcd70fc19580eff7d89a939280b31c47b649c8073dbe4ef638

Contents?: true

Size: 1.31 KB

Versions: 5

Compression:

Stored size: 1.31 KB

Contents

# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2019-2024, by Samuel Williams.
# Copyright, 2020, by Daniel Evans.

require_relative 'server'
require_relative '../proxy_endpoint'

module Falcon
	module Environment
		# Provides an environment for hosting a web application that uses TLS.
		module Application
			include Server
			
			# The middleware stack for the application.
			# @returns [Protocol::HTTP::Middleware]
			def middleware
				::Protocol::HTTP::Middleware::HelloWorld
			end
			
			# The scheme to use to communicate with the application.
			# @returns [String]
			def scheme
				'https'
			end
			
			# The protocol to use to communicate with the application.
			#
			# Typically one of {Async::HTTP::Protocol::HTTP1} or {Async::HTTP::Protocl::HTTP2}.
			#
			# @returns [Async::HTTP::Protocol]
			def protocol
				Async::HTTP::Protocol::HTTP2
			end
			
			# The IPC path to use for communication with the application.
			# @returns [String]
			def ipc_path
				::File.expand_path("application.ipc", root)
			end
			
			# The endpoint that will be used for communicating with the application server.
			# @returns [Async::IO::Endpoint]
			def endpoint
				::Falcon::ProxyEndpoint.unix(ipc_path,
					protocol: protocol,
					scheme: scheme,
					authority: authority
				)
			end
		end
	end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
falcon-0.47.0 lib/falcon/environment/application.rb
falcon-0.46.1 lib/falcon/environment/application.rb
falcon-0.46.0 lib/falcon/environment/application.rb
falcon-0.45.2 lib/falcon/environment/application.rb
falcon-0.45.1 lib/falcon/environment/application.rb