mirror of
https://github.com/yudai/gotty.git
synced 2026-02-16 05:08:06 +01:00
Added path option.
This commit is contained in:
parent
92d8d62ae1
commit
1ca7dea205
3 changed files with 5 additions and 1 deletions
|
|
@ -55,6 +55,7 @@ type App struct {
|
|||
type Options struct {
|
||||
Address string `hcl:"address"`
|
||||
Port string `hcl:"port"`
|
||||
Path string `hcl:"path"`
|
||||
PermitWrite bool `hcl:"permit_write"`
|
||||
EnableBasicAuth bool `hcl:"enable_basic_auth"`
|
||||
Credential string `hcl:"credential"`
|
||||
|
|
@ -85,6 +86,7 @@ var Version = "0.0.13"
|
|||
var DefaultOptions = Options{
|
||||
Address: "",
|
||||
Port: "8080",
|
||||
Path: "",
|
||||
PermitWrite: false,
|
||||
EnableBasicAuth: false,
|
||||
Credential: "",
|
||||
|
|
@ -168,7 +170,7 @@ func (app *App) Run() error {
|
|||
log.Printf("Once option is provided, accepting only one client")
|
||||
}
|
||||
|
||||
path := ""
|
||||
path := app.options.Path
|
||||
if app.options.EnableRandomUrl {
|
||||
path += "/" + generateRandomString(app.options.RandomUrlLength)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue