Optionally auto-detect port