Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
helloxz committed Feb 27, 2020
1 parent 656b248 commit c4eb340
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ccaa_web.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
//使用golan实现一个简单的web来支持AriaNg访问
package main
import "net/http"
import "fmt"

func notfound(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "404 not found!")
}
func main() {
panic(http.ListenAndServe(":6080", http.FileServer(http.Dir("/etc/ccaa"))))
//敏感路径重定向
http.HandleFunc("/aria2.conf", notfound)
http.HandleFunc("/aria2.log", notfound)
http.HandleFunc("/aria2.session", notfound)
http.HandleFunc("/caddy.log", notfound)
http.HandleFunc("/config.json", notfound)
http.HandleFunc("/filebrowser.db", notfound)
}

0 comments on commit c4eb340

Please sign in to comment.