Repository navigation
How to route unknown paths? #783
Description
Activity
Is tide the right tool for a reverse proxy, vs using async-h1 directly?
@jbr It will be a naive simple example just to show how a tide-based server (instance) can handle reverse proxy.
I'm also trying to create a simple tide+surf based reverse-proxy.
I experienced the same behaviour and while hoping for the same expected behaviour...
The work-around I used was:
app.at("/").all(move |mut client_request: Request<()>| async move { ... });
app.at("*").all(move |mut client_request: Request<()>| async move { ... });That combination should route all your unknown paths.
Out of curiosity to understand this use case, do you have other routes in addition to these? If not, using tide will be slower than using async-h1 directly as a reverse proxy. If there is no reason to use tide itself, we probably shouldn't include an example that doesn't use the router or other tide-specific features
This is useful for custom 404's. We should support this.
Reacted by Spike O'Carroll, Tim Fish, Yosh, Kot, Max Countryman and extraymondThanks for the guidance!
I'm working on an async-h1 reverse proxy example. It's pretty basic, as I'm learning Rust.The reverse proxy example would be a great addition!
@spikecodes Which, a reverse proxy or
*matching/?My bad, I meant the reverse proxy example. I now see though that it's a separate PR: #784
This likely needs to be fixed in
route-recognizer; I've filed an issue there: http-rs/route-recognizer#45.Reacted by Mendelt Siebenga, Spike O'Carroll, Jacob Rothstein, Kot and pantosaurIs there a preferred method for showing a 404 page when a route isn't found with Tide today?
Hi.
I'm trying to write a reverse proxy example (#784), but I don't know how to route all possible paths. Consider the following example:
now, take a look this tests below:
Well, since wildcard allows anything, it should return
okinand/too. 😕Thank you!