sub sockInit{
use AnyEvent::WebSocket::Client 0.12;
use URI
my $client = AnyEvent::WebSocket::Client->new( );
my $uri = URI->new('ws://mydomain.com/ws/test');
$client->connect($uri)->cb(sub {
our $connection = eval { shift->recv };
if($@) {
# handle error...
myDebug($@);
return;
}
# send a message through the websocket...
# $connection->send('ping');
});
}
####
#AnyEvent::Socket::tcp_connect $uri->host, $uri->port, sub {
AnyEvent::Socket::tcp_connect $uri->as_string, 80, sub {
my $fh = shift;
unless($fh)
{
$done->croak("unable to connect to ".$uri->as_string." $!");
return;
}
####
unable to connect to ws://mydomain.com/ws/test No such device or address at /usr/share/squeezeboxserver/Plugins/Alexa/HabProxy.pm line 201.
####
ProxyPass /ws ws://127.0.0.1:1880/ws
ProxyPassReverse /ws ws://127.0.0.1:1880/ws