Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

Commit

Permalink
Add variables for http and https proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
mdom committed Jan 23, 2017
1 parent 40e87a7 commit d6de647
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.pod
Expand Up @@ -139,6 +139,14 @@ Path to TLS key file.

Path to TLS cert file.

=item http_proxy

Use this proxy for http connections.

=item https_proxy

Use this proxy for https connections.

=item disclose_identity

Include nick and twturl in twtxt's user-agent. To respect your privacy this
Expand Down
8 changes: 8 additions & 0 deletions bin/txtnix
Expand Up @@ -150,6 +150,14 @@ Path to TLS key file.
Path to TLS cert file.
=item http_proxy
Use this proxy for http connections.
=item https_proxy
Use this proxy for https connections.
=item disclose_identity
Include nick and twturl in twtxt's user-agent. To respect your privacy this
Expand Down
9 changes: 8 additions & 1 deletion lib/App/txtnix.pm
Expand Up @@ -48,12 +48,13 @@ has character_limit => sub { 1024 };
has expand_me => sub { 0 };
has hooks => sub { 1 };
has registry => sub { "https://roster.twtxt.org" };
has sign => sub { 0 };

has unfollow_codes => sub { { "410" => 1 } };

has [
qw( colors twturl pre_tweet_hook post_tweet_hook config_file config_dir
force key_file cert_file plugins cache pager)
force key_file cert_file plugins cache pager http_proxy https_proxy)
];

sub new {
Expand Down Expand Up @@ -190,6 +191,12 @@ sub _build_ua {
$ua->ca( $self->ca_file );
$ua->cert( $self->cert_file ) if $self->cert_file;
$ua->key( $self->key_file ) if $self->key_file;
if ( $self->http_proxy ) {
$ua->proxy->http( $self->http_proxy );
}
if ( $self->https_proxy ) {
$ua->proxy->https( $self->https_proxy );
}
return $ua;
}

Expand Down

0 comments on commit d6de647

Please sign in to comment.