Open daxpedda opened 1 year ago
I think it is out of scope. Keep the issue open for a while in case there is a demand for this.
I released a crate doing all of this now: https://crates.io/crates/axum-server-dual-protocol.
When I send http request to my https server, the server just close the connection, reply me nothing, while I expect an error code like 497.
@hangj I assume you mean this is the current behavior of axum-server
and not axum-server-dual-protocol
?
@daxpedda yes, its the current behavior of axum-server
When I send http request to my https server, the server just close the connection, reply me nothing, while I expect an error code like 497.
You can't use same port for http and https if you are asking that. You might want to check out axum-server-dual-protocol
if you want to do that. If the problem is that https not working then write an example and I will look into it.
When I send http request to my https server, the server just close the connection, reply me nothing, while I expect an error code like 497.
You can't use same port for http and https if you are asking that. You might want to check out
axum-server-dual-protocol
if you want to do that. If the problem is that https not working then write an example and I will look into it.
Thank you, I'll check it out, and see what I can do.
I wrote an
Accept
or that allows handling of HTTP and HTTPS on the same port. The implementation is fairly minimal and simple. Is it in scope foraxum-server
to add something like this? Happy to start a PR of course.My use-case is hosting a HTTPS server on a custom port, unlike the example, there is only one port. So connecting with HTTP to that server errors out. The idea is if I accept both protocols, I can design a middleware that handles the redirect.