#Middleware for HTTP upgrade server doesn't do anything

1 messages · Page 1 of 1 (latest)

steel bough
#

So, I'm trying to create a redirection middleware (without copying / importing a crate) that just gets a port and redirects that traffic towards a new port with a certain scheme / protocol. The problem is it doesn't work!

I am making two servers (of type HttpServer): upgrade_server on http://localhost:8080 and website_server on https://localhost:8443. They work nicely if I put normal behaviour logic (services, routes, etc) - even with ssl, but my middleware is completely ignored. If I run the servers where my upgrade_server uses my middleware only (which should suffice) then I get a 404 - not found error instead of being redirected to my website_server. Can anyone help me out?

remote sable
#

The 404: I suspect it's because uri.port_u16() returns None

#

What's the use case for running 2 "services" that need separate HTTPS redirections? Is like admin and public endpoints segregated by port?