It's too much to write a full answer about your problem, since I haven't worked with Catalyst since a long time ago, but here you go a simple working UNIX Socket perl-server, node-client proposal
Server :
#!/usr/bin/perl -w -T
use strict;
use IO::Socket::UNIX;
use threads;
my $socket_path = "/tmp/test_socket";
unlink($socket_path);
my $socket = IO::Socket::UNIX->new(
Local => $socket_path,
Type => SOCK_STREAM,
Listen => 1,
);
die "Can't create socket: $!" unless $socket;
print "waiting for connections\n";
while (1) {
my $client;
do {
$client = $socket->accept;
} until ( defined($client) );
my $thr = threads->new( \&processit, $client )->detach();
}
sub processit {
my ($client) = @_;
if($client->connected){
print $client "Hello from server\n";
while(<$client>) { print "$_\n" };
}
close( $client );
}
Client :
#!/usr/bin/env node
var net = require('net'),
fs = require('fs'),
sock;
var c = net.createConnection('/tmp/test_socket');
c.on('connect', function(socket) {
console.log('connected');
c.write("Hello from NodeJS");
c.on('data', function(data) { console.log('perl: '+data.toString()) });
});