se Socket;
use IO::Socket;
use LWP::Simple qw(get);
use URI::Escape qw(uri_escape);
use JSON qw(to_json from_json);
use Data::Dumper;
# get commandline arguments
my ($ModulesPath, $Port) = @ARGV;
#
else {
$data{"_method"} = "ERROR";
}
# analyse request and create answer
my $info = from_json($data{'data'});
#print STDERR Dumper($info);
my $quit = 0;
$quit = 1 if exists $info->{'ev
t "Content-type: application/json", Socket::CRLF;
print $client "Content-type: text/html", Socket::CRLF;
print $client Socket::CRLF;
print $client ((($answer && to_json($answer)) || '{"action":"non