From e32dd868e64ee1010b50826bc6b2adac7fd3eac9 Mon Sep 17 00:00:00 2001 From: Alex Sergeyev Date: Sun, 19 Oct 2014 21:17:34 -0400 Subject: [PATCH] Basepath removed. --- config.go | 3 --- help.go | 3 --- main.go | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/config.go b/config.go index f135330a..71bb9550 100644 --- a/config.go +++ b/config.go @@ -19,7 +19,6 @@ import ( ) type Config struct { - BasePath string // Base URL path. e.g. "/" Addr []string // TCP addresses to listen on. e.g. ":1234", "1.2.3.4:1234" or "[::1]:1234" MaxForks int // Number of allowable concurrent forks LogLevel libwebsocketd.LogLevel @@ -74,7 +73,6 @@ func parseCommandLine() *Config { maxForksFlag := flag.Int("maxforks", 0, "Max forks, zero means unlimited") // lib config options - basePathFlag := flag.String("basepath", "/", "Base URL path (e.g /)") reverseLookupFlag := flag.Bool("reverselookup", true, "Perform reverse DNS lookups on remote clients") scriptDirFlag := flag.String("dir", "", "Base directory for WebSocket scripts") staticDirFlag := flag.String("staticdir", "", "Serve static content from this directory over HTTP") @@ -112,7 +110,6 @@ func parseCommandLine() *Config { mainConfig.Addr = []string{fmt.Sprintf(":%d", port)} } mainConfig.MaxForks = *maxForksFlag - mainConfig.BasePath = *basePathFlag mainConfig.LogLevel = libwebsocketd.LevelFromString(*logLevelFlag) if mainConfig.LogLevel == libwebsocketd.LogUnknown { fmt.Printf("Incorrect loglevel flag '%s'. Use --help to see allowed values.\n", *logLevelFlag) diff --git a/help.go b/help.go index d02d964f..d0b21ca0 100644 --- a/help.go +++ b/help.go @@ -54,9 +54,6 @@ Options: --passenv VAR[,VAR...] Lists environment variables allowed to be passed to executed scripts. - --basepath=PATH Base path in URLs to serve from. - Default: / (root of domain) - --reverselookup={true,false} Perform DNS reverse lookups on remote clients. Default: true diff --git a/main.go b/main.go index 7d51ab70..ed3b5212 100644 --- a/main.go +++ b/main.go @@ -51,7 +51,7 @@ func main() { os.Clearenv() // it's ok to wipe it clean, we already read env variables from passenv into config handler := libwebsocketd.NewWebsocketdServer(config.Config, log, config.MaxForks) - http.Handle(config.BasePath, handler) + http.Handle("/", handler) if config.UsingScriptDir { log.Info("server", "Serving from directory : %s", config.ScriptDir)