Updated to allow client to select port