Refactored protocol detection and updated urls.yml