start work on outbound proxy stuff
This commit is contained in:
parent
4468b8b8e1
commit
8316c19852
3 changed files with 12 additions and 2 deletions
|
|
@ -47,6 +47,7 @@ module DiasporaFederation
|
|||
@http_verbose = false
|
||||
@http_redirect_limit = 4
|
||||
@http_user_agent = "DiasporaFederation/#{DiasporaFederation::VERSION}"
|
||||
@http_proxy = nil
|
||||
|
||||
class << self
|
||||
# {Callbacks} instance with defined callbacks
|
||||
|
|
@ -128,6 +129,13 @@ module DiasporaFederation
|
|||
# @return [String] user agent
|
||||
attr_reader :http_user_agent
|
||||
|
||||
# HTTP proxy address
|
||||
# @overload http_proxy
|
||||
# @return [String] http proxy address
|
||||
# @overload http_proxy=
|
||||
# @param [String] value http proxy address
|
||||
attr_accessor :http_proxy
|
||||
|
||||
# Configure the federation library
|
||||
#
|
||||
# @example
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ module DiasporaFederation
|
|||
method: :post,
|
||||
verbose: DiasporaFederation.http_verbose,
|
||||
cainfo: DiasporaFederation.certificate_authorities,
|
||||
forbid_reuse: true
|
||||
forbid_reuse: true,
|
||||
proxy: DiasporaFederation.http_proxy
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@ module DiasporaFederation
|
|||
private_class_method def self.create_default_connection
|
||||
options = {
|
||||
request: {timeout: DiasporaFederation.http_timeout},
|
||||
ssl: {ca_file: DiasporaFederation.certificate_authorities}
|
||||
ssl: {ca_file: DiasporaFederation.certificate_authorities},
|
||||
proxy: {uri: DiasporaFederation.http_proxy}
|
||||
}
|
||||
|
||||
@connection = Faraday::Connection.new(options) do |builder|
|
||||
|
|
|
|||
Loading…
Reference in a new issue