Skip to content

Commit

Permalink
Add route_by_http_user option
Browse files Browse the repository at this point in the history
  • Loading branch information
koho committed May 28, 2022
1 parent fe08a6a commit 7a50e2a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/config/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ type Proxy struct {
HTTPPwd string `ini:"http_pwd,omitempty" http:"true"`
HostHeaderRewrite string `ini:"host_header_rewrite,omitempty" http:"true"`
Multiplexer string `ini:"multiplexer,omitempty" tcpmux:"true"`
RouteByHTTPUser string `ini:"route_by_http_user,omitempty" http:"true" tcpmux:"true"`
}

// GetAlias returns the alias of this proxy.
Expand Down
5 changes: 5 additions & 0 deletions pkg/consts/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,8 @@ const (
AuthToken = "token"
AuthOIDC = "oidc"
)

// TCP multiplexer
const (
HTTPConnectTCPMultiplexer = "httpconnect"
)
8 changes: 7 additions & 1 deletion ui/editproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,13 @@ func (pd *EditProxyDialog) baseProxyPage() TabPage {
Label{Visible: Bind("vm.HTTPVisible"), Text: "URL 路由:"},
LineEdit{Visible: Bind("vm.HTTPVisible"), Text: Bind("Locations")},
Label{Visible: Bind("vm.MuxVisible"), Text: "复用器:"},
LineEdit{Visible: Bind("vm.MuxVisible"), Text: Bind("Multiplexer")},
ComboBox{
Visible: Bind("vm.MuxVisible"),
Model: []string{consts.HTTPConnectTCPMultiplexer},
Value: Bind("Multiplexer"),
},
Label{Visible: Bind("vm.MuxVisible || vm.HTTPVisible"), Text: "路由用户:"},
LineEdit{Visible: Bind("vm.MuxVisible || vm.HTTPVisible"), Text: Bind("RouteByHTTPUser")},
},
}
}
Expand Down

0 comments on commit 7a50e2a

Please sign in to comment.