elixir-mint / mint

Functional HTTP client for Elixir with support for HTTP/1 and HTTP/2 🌱
Apache License 2.0
1.36k stars 106 forks source link

Fix scheme() type #323

Closed elridion closed 3 years ago

elridion commented 3 years ago

Functions like connect/4 that use scheme_to_transport/1 subsequentially allow for modules to be used as a scheme. The scheme type now reflects this.

ericmj commented 3 years ago

Thanks for the PR but transports are not public API so we only expose :http and :https.

elridion commented 3 years ago

Does this mean custom modules are not intended to to be used (e.g. work) when used as scheme?

ericmj commented 3 years ago

They may work but they are not public API so you should not use them and they may break at any time in an update.

Do you need custom transports, if so what's the use case?

dannote commented 3 years ago

I have a use case — I made a Tor implementation in Elixir (will be open-sourced soon) and relied on this feature

dannote commented 3 years ago

@ericmj I have decided to publish it a little ahead of time, so it's a bit unpolished, but here it is!

elridion commented 3 years ago

@ericmj my use case is running a Mint.Transport implementation based on erlangs :socket. In this particular case I'm relying on a file based UNIX socket that communicates via HTTP/1