Browser Testing

Simple browser testing

Not very often, but sometimes testing needs to be done for a specific webbrowser to sort out some graphical issues. I stumbled upon http://crossbrowsertesting.com which has vnc to a lot of different environments. Works very well, its as slow as vnc over internet is, but its fully capable of doing testing in different browsers.

Although, I wanted it to be able to access my development environment, preferably without showing it off to the rest of the world. And of course without the need to deploy each test in some public environment.

The simple solution was to create a ssh-tunnel, from a public ip(server) into my development machine, and since the development machine(my laptop) changes external ipaddress and firewall settings depending on where I am, the connection is initiated from the laptop.

PUBLICIP in the example below is the external(public) host. I use port 8000, because 80 is taken by a normal apache, but any port can really be used. On the laptop(localhost) in this case the port is the normal 80.

ssh -f -N -RPUBLICIP:8000:localhost:80 PUBLICIP

However, as a security measurement, sshd on PUBLICIP have the setting “GatewayPorts” set to the default no. Change it to yes in /etc/ssh/sshd_config or add it if necessary: GatewayPorts yes

Now I can access PUBLICIP:8000 and the request is forwarded to my local development webserver at localhost:80.

A virtualhost on the development webserver is good, so you can forward the request to the correct site that you are debugging. I’ve used the most simple one as seen below. Its a bit strange, but PUBLICIP is here regarded as the hostname, which is convenient, because it wont interfere with your other virtualhosts.

<VirtualHost 127.0.0.1>
	ServerName PUBLICIP
	DocumentRoot /home/eric/dev/website1/
</VirtualHost>

Works really good, and by adding a basic auth password protection to the virtualhost you can avoid other people looking at your work. Or even use https. Havent tried that yet though.



blog comments powered by Disqus