mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
parent
1c9fd32533
commit
12c3103039
1 changed files with 23 additions and 32 deletions
|
@ -5,17 +5,14 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
"archive/zip"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/remyoudompheng/go-misc/zipfs"
|
|
||||||
|
|
||||||
"github.com/RiV-chain/RiV-mesh/src/config"
|
"github.com/RiV-chain/RiV-mesh/src/config"
|
||||||
"github.com/RiV-chain/RiV-mesh/src/core"
|
"github.com/RiV-chain/RiV-mesh/src/core"
|
||||||
)
|
)
|
||||||
|
@ -271,13 +268,7 @@ func (a *AdminSocket) StartHttpServer(nc *config.NodeConfig) {
|
||||||
}
|
}
|
||||||
fmt.Fprintf(w, string(b[:]))
|
fmt.Fprintf(w, string(b[:]))
|
||||||
})
|
})
|
||||||
fs := http.Dir(nc.WwwRoot)
|
http.Handle("/", http.FileServer(http.Dir(nc.WwwRoot)))
|
||||||
pak, err := zip.OpenReader(nc.WwwRoot)
|
|
||||||
if err == nil {
|
|
||||||
fs = zipfs.NewZipFS(&pak.Reader)
|
|
||||||
defer pak.Close()
|
|
||||||
}
|
|
||||||
http.Handle("/", http.FileServer(fs))
|
|
||||||
l, e := net.Listen("tcp4", u.Host)
|
l, e := net.Listen("tcp4", u.Host)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
a.log.Errorln("%s\n", e)
|
a.log.Errorln("%s\n", e)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue