Skip to content

Commit

Permalink
Merge pull request joewalnes#91 from asergeyev/delbasepath
Browse files Browse the repository at this point in the history
Basepath removed.
  • Loading branch information
asergeyev committed Oct 20, 2014
2 parents 98d35c0 + e32dd86 commit 9f9f81e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
3 changes: 0 additions & 3 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions help.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9f9f81e

Please sign in to comment.