This node app attempts to run ssh via require('child_process').spawn with the following arguments:
$ ssh -tt -l ubuntu -N -i ~/.ssh/scrapers.pem -D 9050 0.0.0.0 -o StrictHostKeyChecking=no
... where 'ubuntu' is the username for the AWS EC2 AMI you are SSHing to and '0.0.0.0' is the IP address for the instance.
To replicate this issue, edit app.js to include the path to your *.pem file to login to the instance you want to ssh and the IP address of that machine, then run it with:
$ node app.js
To confirm an SSH dynamic tunnel has been created and is working, run this line:
$ casperjs casperproxytest.js --proxy=127.0.0.1:9050 --proxy-type=socks5
If you don't have phantomjs and casperjs installed, you can install them both with brew:
$ brew install phantomjs
$ brew install casperjs