In my current contribution to rumqttd crate, I should parse a user configurable URI to handle the right protocol logic between these unix://, wss://, ws:// and tcp://. I don't want to redo the wheel.
@Cyborus, the scheme method should do the trick. But parsing an ip:port is not possible without a scheme (e.g. 127.0.0.1:8080).