substack/testling — pull request #96 by eugeneware (2014-09-20 09:23:09+00:00)
Title: Ability to tell the browser to connect to a specific host and port.

When using the testling command to test browsers running in Virtual Machines (ie. IE), the URL that gets generated is always `localhost`. This will resolve to `localhost` in the VM, which obviously won't work.

This PR allows you to override the hostname that is provided to the browser when it is launched, as well as the port too.

I'm using testling with the [iectrl](https://github.com/xdissent/iectrl) command line tool to automatically launch IE in a VirtualBox VM, and then to pass it the URL, like so:

``` bash
# run test in ie9 and then close the browser (10.0.2.2 is the host IP that ievms initializes)
$ browserify test/ie.js | testling --host=10.0.2.2 -x 'iectrl open -s 9'; iectrl close
```
It's also useful to be able to hard code the port if you are continually debugging a test, so you can just refresh the browser with the same port rather than use the randomly assigned ports.

``` bash
# listen on port 9000
$ browserify test/ie.js | testling --host=10.0.2.2 --port 9000 -u
http://10.0.2.2:9000/__testling?show=true
```