use JSON;
use Net::HTTP::Spore;
use Net::HTTP::Spore::Middleware::DefaultParams;
use Net::HTTP::Spore::Middleware::Format::Text;
my $spec = {
name => 'BrowserMob Proxy',
formats => ['json'],
[
'port'
],
description => 'Create a new proxy. Returns a JSON object {"port": your_port} on success"'
},
delete_proxy => {
method =
equired_params => [
'port'
],
description => 'returns the JSON/HAR content representing all the HTTP traffic passed through the proxy'
},
auth_b
rl client to control the Browsermob Proxy server
use strict;
use warnings;
use Moo;
use Carp;
use JSON;
use LWP::UserAgent;
use IO::Socket::INET;
use Browsermob::Proxy;
has path => (
is => 'rw',
_addr . ':' . $self->server_port . '/proxy');
if ($res->is_success) {
my $list = from_json($res->decoded_content)->{proxyList};
my @proxies = map {
$_->{port};