in reply to Socket connection refused problem

Get rid of «LocalHost => 'localhost'». Your specifically only allow connection from the loopback adapter. If you don't specify LocalHost, connections will be accepted from any interface.