Implement custom port setting

 Fixes #1