Restructured proxy routing logic

- Moved virtual directory into host routing object
- Generalized root and hosts routing struct
- Optimized UI
This commit is contained in:
Toby Chui
2024-02-13 21:46:43 +08:00
parent 36e461795a
commit 3228789375
26 changed files with 1125 additions and 1156 deletions

View File

@@ -89,7 +89,7 @@ func (ws *WebServer) RestorePreviousState() {
ws.option.EnableDirectoryListing = enableDirList
//Check the running state
webservRunning := false
webservRunning := true
ws.option.Sysdb.Read("webserv", "enabled", &webservRunning)
if webservRunning {
ws.Start()
@@ -124,6 +124,11 @@ func (ws *WebServer) ChangePort(port string) error {
return nil
}
// Get current using port in options
func (ws *WebServer) GetListeningPort() string {
return ws.option.Port
}
// Start starts the web server.
func (ws *WebServer) Start() error {
ws.mu.Lock()