Skip to content

Commit

Permalink
test failed SOCKS authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 30, 2014
1 parent afce098 commit 8e733f6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions t/mojo/user_agent_socks.t
Expand Up @@ -106,10 +106,16 @@ Mojo::IOLoop->singleton->reactor->io(
}
);

# Simple request with SOCKS proxy
# Failed authentication with SOCKS proxy
my $ua = Mojo::UserAgent->new(ioloop => Mojo::IOLoop->singleton);
$ua->proxy->http("socks://foo:bar\@127.0.0.1:$port");
$ua->proxy->http("socks://foo:baz\@127.0.0.1:$port");
my $tx = $ua->get('/');
ok !$tx->success, 'not successful';
ok $tx->error, 'has error';

# Simple request with SOCKS proxy
$ua->proxy->http("socks://foo:bar\@127.0.0.1:$port");
$tx = $ua->get('/');
ok $tx->success, 'successful';
ok !$tx->kept_alive, 'kept connection not alive';
ok $tx->keep_alive, 'keep connection alive';
Expand Down

0 comments on commit 8e733f6

Please sign in to comment.