#!/usr/bin/perl
#Modify the config.json.sample fle,run this script, config your beowser
# to use socks 5 proxy with remote DNS support and you can now break
# through the great firewall of china.

use 5.010;
use strict;
use warnings;
use JSON;
use Net::Shadowsocks;

local $/;
open(my $fh, '<', 'config.json') or die "Can't open  config.json: $!";
my $confg_json = <$fh>;
close($fh) || warn "close failed: $!";
my $config    = decode_json($confg_json);
my $_tcp_host = $config->{'local_address'};

my $_tcp_service   = $config->{'local_port'};
my $_password      = $config->{'password'};
my $_remotehost    = $config->{'server'};
my $_remoteservice = $config->{'server_port'};

my $foo = Net::Shadowsocks->new(
                                local_address => $_tcp_host,
                                local_port    => $_tcp_service,
                                password      => $_password,
                                server        => $_remotehost,
                                server_port   => $_remoteservice
                               );

