Saturday, July 25, 2009

Linking xPL Between Two Homes Over The Internet

As I wrote before, I would like to link xPL messages from our 2nd home. I needed to figure out a way to wrap the UDP xPL messages in TCP and tunnel them through some kind of connection. I decide to use EventGhost's Network Event Sender/Receiver plugins so I wouldn't have to write a separate app.

The first step is to establish a secure connection between the two networks. I chose SSH as I already have a device capable of being an SSH server at our 2nd/remote home. I will establish the SSH connection using Putty from our 1st home.



I'm creating a tunnel that will map port 8888 on the remote SSH server to port 8888 on my local machine. I'll need to click the Add button to enable it. I also checked Remote ports do the same, which will allow devices on the remote network to connect to the remote SSH server's port 8888. To enable this remote forwarding, you may have to configure your SSH server. For example, with OpenSSH, you need to add GatewayPorts yes to the sshd_config file.

Once that's set up, I can establish the SSH connection. On the local machine, I will add the Network Event Receiver plugin, point it to port 8888, set a password and an event prefix. On the remote machine, I will add the Network Event Sender plugin and point it the remote SSH server's port 888 and set a password to match the receiver.


Local EventGhost


Remote EventGhost


Now, in the remote EventGhost, I create a macro that captures all xPL messages and sends them the Network Event Sender.



Finally, on the local EventGhost, I create a Network Event Receiver macro that parses the data received and issues an xPL message with the original contents, but with the local EG as the sender instead of the original sender.




That's all there is to it. Now, I've got remote xPL messages coming across to my home network. You can easily add a remote EG receiver and local EG sender to allow xPL messages to flow in the opposite direction.

1 comment: