kismetwireless / kismet

Github mirror of official Kismet repository
Other
1.56k stars 304 forks source link

Webserver rewrite base / catchall fallback route #413

Open omnidepp opened 2 years ago

omnidepp commented 2 years ago

Hi Everyone, I'm building a kismet web plugin with vue as a single page application with routes. For this to work properly, the kismet webserver would need to rewrite all virtual routes to /index.html. Is there an option to do this with the kismet internal webserver?

My SPA uses virtual routes that should be accessed like this: http://kismet_url:2501/plugin/plugin_name/device/12345. So kismet webserver should catch all these virtual routes and rewrite them to ...plugin/plugin_name/index.html.

For webservers like apache and nginx, here is some documentation on how to accomplish this: https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations

dragorn commented 1 year ago

Currently there's nothing in Kismet to handle that; you could proxy it through an nginx that caught 404s and rewrite them in the interim; I'll put an optional catch-all config option on the list for future releases.

The kismet webserver isn't based on nginx/apache/etc or anything like that; it's a fully-integrated webserver that uses boost::beast as the base protocol handler, so there isn't any correlation between its configs and those of apache/nginx/etc.

-m

------- Original Message ------- On Thursday, March 10th, 2022 at 6:42 AM, omnidepp @.***> wrote:

Hi Everyone, I'm building a kismet web plugin with vue as a single page application with routes. For this to work properly, the kismet webserver would need to rewrite all virtual routes to /index.html. Is there an option to do this with the kismet internal webserver?

My SPA uses virtual routes that should be accessed like this: http://kismet_url:2501/plugin/plugin_name/device/12345. So kismet webserver should catch all these virtual routes and rewrite them to ...plugin/plugin_name/index.html.

For webservers like apache and nginx, here is some documentation on how to accomplish this: https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you are subscribed to this thread.Message ID: @.***>