Friday, October 24, 2008

Using Rinetd in Parallels on a Mac for testing your local web applications in IE

Firefox is great for web application development but due to Internet Explorers market-share, testing your application against it is mandatory. I use a Mac at home and within it I run Windows using Parallels. This works really fantastic and while my parallels instance is running, I can access my web application from within IE using my host system's IP address (I use 'Shared Networking' within Parallels).

Of course you can make accessing you local webserver a little bit more comfortable by using the Windows hosts file under %SystemRoot%\system32\drivers\etc\ to bind the IP address of my Mac instance to a more descriptive name.

However, there is still a problem with all those third party webservices such as Google Maps API and reCaptcha. When you sign up with them you create a key that works against a defined domain name. Nevertheless, for testing you can typically also use http://localhost/ etc. which is nice as I only need one key for both deployment and local testing.

Well, for accessing your web application from within parallels via localhost, rinetd works like a charm. Rinetd does port redirection and it is a tiny little command line utility that runs as a daemon. Originally from the Linux world there is also a Windows port available.

After downloading, all you have to do is to create/edit the config file rinetd.conf. In it I have only one line:

127.0.0.1 8080 10.211.55.2 8080

This line redirects all local calls on port 8080 to port 8080 of the ip address 10.211.55.2.

No comments: