display message when viewing server in browser
This commit is contained in:
parent
74d18e781a
commit
d05b93768c
File diff suppressed because one or more lines are too long
|
@ -2,7 +2,9 @@ package proxy
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
func (p *ForwardProxyCluster) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
|
@ -12,9 +14,11 @@ func (p *ForwardProxyCluster) ServeHTTP(w http.ResponseWriter, req *http.Request
|
|||
} else {
|
||||
// HTTP
|
||||
if req.URL.Scheme != "http" {
|
||||
msg := fmt.Sprintf(`unsupported protocal "%s"`, req.URL.Scheme)
|
||||
log.Errorf(msg)
|
||||
http.Error(w, msg, http.StatusBadRequest)
|
||||
//msg := fmt.Sprintf(`unsupported protocal "%s"`, req.URL.Scheme)
|
||||
//log.Errorf(msg)
|
||||
//http.Error(w, msg, http.StatusBadRequest)
|
||||
rand.New(rand.NewSource(time.Now().Unix()))
|
||||
fmt.Fprint(w, "proxy-loadbalancer\n<https://git.evulid.cc/cyberes/proxy-loadbalancer>\n\n"+retardation[rand.Intn(len(retardation))])
|
||||
return
|
||||
}
|
||||
p.proxyHttpConnect(w, req)
|
||||
|
|
Loading…
Reference in New Issue