sub http_thread
{
my $hDaemon = HTTP::Daemon::SSL->new(LocalPort => 8001,
SSL_key_file => $curDir . "/certs/server-key.pem",
SSL_cert_file => $curDir . "/certs/server-cert.pem" )
|| die "Can't start SSH Daemon. $!\n";
my $soap = SOAP::Transport::HTTP::Server
-> new ( )
-> dispatch_to(qw(auth));
while (my $hHTTP = $hDaemon->accept)
{
while (my $request = $hHTTP->get_request)
{
my $req = $request->{_headers}{soapaction};
$soap->request($request);
$soap->handle();
my $response = $soap->response();
$hHTTP->send_response($response);
}
$hHTTP->close();
undef( $hHTTP );
}
}
####
$hThread = threads->create( {'void' => 1}, \&http_thread );
####
package auth;
use Devel::Peek;
sub new
{
my $pkg = shift;
my $self = {};
bless ($self, $pkg);
my $cur_time = time;
$auth_sessions { $cur_time } = 0;
$self->{ SESSIONID } = $cur_time;
Dump $self;
return $self;
}
sub temp
{
my $self = shift;
print "\n\n\ntemp\n";
Dump ($self);
}
####
use SOAP::Lite +autodispatch =>
proxy => 'https://server:8001/';
my $obj = auth->new();
use Devel::Peek();
print Dump($obj);
$obj->temp();
exit;