Monday, 2 February 2009

The Microsoft Loopback Adapter

I had a situation once where the IP address of an SMTP server had been hard-coded and I could only run the application successfully if the server was available. This meant that developing off-site was a problem. Then, from somewhere in the back of my mind, I remembered about the Microsoft Loopback Adapter (MSLA). This is a software network adapter i.e. you don't have to physically install a NIC. Installing this network adapter (add new hardware and choose the Microsoft Loopback Adapter from the list) allows me to easily route a given IP address to my local machine. For instance, if I manually assign the IP address of the MSLA to 192.168.0.100, then any requests bound for this IP address from my machine will end up at my machine. It's like saying "route any requests to 192.168.0.100 to 127.0.0.1". I installed a local SMTP server and my application sent emails to this local server via the MSLA. All I had to do was to remember to disable the network adapter when I was back on-site and wanted to use the real SMTP server.



No comments:

Post a Comment