Allow passing a custom protocol.

This allows swagger definitions to work properly when the API is behind
an SSL terminator.