mirror of
https://github.com/Gouryella/drip.git
synced 2026-05-03 23:36:56 +00:00
feat(proxy): Support independent configuration for service domain and tunnel domain
- Add serverDomain and tunnelDomain fields to the Handler struct to distinguish between service domain and tunnel domain - Modify the NewHandler function signature to support passing two separate domain parameters - Update the extractSubdomain method to return a subdomain result type with three states: home, found, notFound - Add serveTunnelNotFound method to handle tunnel not found cases, returning a 404 page - Add favicon support to display an icon on the page - Adjust routing logic to display a dedicated 404 page when accessing a tunnel domain but the corresponding tunnel is not found
This commit is contained in:
@@ -285,7 +285,7 @@ func runServer(cmd *cobra.Command, _ []string) error {
|
||||
|
||||
listenAddr := fmt.Sprintf("0.0.0.0:%d", cfg.Port)
|
||||
|
||||
httpHandler := proxy.NewHandler(tunnelManager, logger, cfg.TunnelDomain, cfg.AuthToken, cfg.MetricsToken)
|
||||
httpHandler := proxy.NewHandler(tunnelManager, logger, cfg.Domain, cfg.TunnelDomain, cfg.AuthToken, cfg.MetricsToken)
|
||||
httpHandler.SetAllowedTransports(cfg.AllowedTransports)
|
||||
httpHandler.SetAllowedTunnelTypes(cfg.AllowedTunnelTypes)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user