Skip to content

Commit

Permalink
Merge pull request #31 from iselt/master
Browse files Browse the repository at this point in the history
增加配置监听地址功能
  • Loading branch information
lanyi1998 authored Aug 28, 2024
2 parents fa3d147 + f9bf764 commit c01f0d3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions Core/Core.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

var Config = struct {
HTTP struct {
Host string `yaml:"host"`
Port string `yaml:"port"`
User map[string]string `yaml:"user"`
ConsoleDisable bool `yaml:"consoleDisable"`
Expand Down
4 changes: 2 additions & 2 deletions Http/Core.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ func ListingHttpManagementServer() {

log.Println("Http Listing Start...")
server := &http.Server{
Addr: ":" + Core.Config.HTTP.Port,
Addr: Core.Config.HTTP.Host + ":" + Core.Config.HTTP.Port,
Handler: mux,
}
log.Println("Http address: http://" + "0.0.0.0:" + Core.Config.HTTP.Port)
log.Println("Http address: http://" + Core.Config.HTTP.Host + ":" + Core.Config.HTTP.Port)
if err := server.ListenAndServe(); err != nil {
log.Fatal(err)
}
Expand Down
1 change: 1 addition & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
HTTP:
host: 0.0.0.0
port: 8000
#{"token":"用户对应子域名"}
user: { "admin": "dnslog" }
Expand Down

0 comments on commit c01f0d3

Please sign in to comment.