segmentio/nightmare — pull request #16 by stevenschobert (2014-04-28 21:52:51+00:00)
Title: Add option for setting PhantomJS port

Hey guys!

First off thanks for the awesome PhantomJS wrapper. I really enjoy the approach you took to queuing actions upfront, and the plugin architecture.

----

I ran into a scenario where multiple Nightmare instances would be spun up at the same time, but in separate node processes, and found that the ports were colliding between the two processes.

In order to work around this, I added an option to the constructor for specifying port, so that I could eventually randomize the port when the node processes were being created to minimize collision.

I thought post back the contribution, to get your guys feedback on it. I didn't see any specific tests around constructor options, but I'm happy to add some, if you guys want.

Thanks!