allow javascript to use dynamic hostname and port
Merge pull request #2 from rymo/master

dynamic host and port for index.js