uWebSockets icon indicating copy to clipboard operation
uWebSockets copied to clipboard

Add / remove HTTP routes dynamically (better SNI support)

Open ghost opened this issue 4 years ago • 2 comments

Passing nullptr to app.get(url, .. can be a way to unregister that route.

ghost avatar Oct 09 '21 08:10 ghost

This can only be done for HTTP routes, WS routes cannot be removed

ghost avatar Jan 04 '22 20:01 ghost

It's not just about adding/removing routes - it also needs to be per SNI.

You should attach routes to SNI domains, not the app itself.

App.sni("www.example.com").get("/someurl").post("/url").sni("www.another.com").get("/helllo").listen(3000).run()

To be backwards compatible it should default to "all" if you don't specify with sni what domain it is for.

ghost avatar May 20 '22 09:05 ghost

There is now initial app.domain(server name).get(...).domain(another server name).get(...) support added.

uNetworkingAB avatar Sep 25 '22 22:09 uNetworkingAB

Technically this is possible now - you can add and remove Server names, which removes all URL routes. So it is possible to remove-all-then-add-some to achieve removal

uNetworkingAB avatar Sep 26 '22 00:09 uNetworkingAB