New functions

This commit is contained in:
刘河
2019-02-24 13:17:43 +08:00
parent 750ecb824a
commit db43405237
20 changed files with 287 additions and 74 deletions

View File

@@ -154,10 +154,10 @@ func (s *httpServer) process(c *conn.Conn, r *http.Request) {
isConn = false
} else {
r, err = http.ReadRequest(bufio.NewReader(c))
logs.Trace("New http(s) connection,clientId %d,host %s,url %s,remote address %s", host.Client.Id, r.Host, r.URL, r.RemoteAddr)
if err != nil {
break
}
logs.Trace("New http(s) connection,clientId %d,host %s,url %s,remote address %s", host.Client.Id, r.Host, r.URL, r.RemoteAddr)
if host, err = file.GetCsvDb().GetInfoByHost(r.Host, r); err != nil {
logs.Notice("the url %s %s can't be parsed!", r.Host, r.RequestURI)
break

View File

@@ -52,8 +52,11 @@ func DealBridgeTask() {
if !t.Client.GetConn() {
logs.Info("Connections exceed the current client %d limit", t.Client.Id)
s.Conn.Close()
} else {
} else if t.Status {
go proxy.NewBaseServer(Bridge, t).DealClient(s.Conn, t.Target, nil)
} else {
s.Conn.Close()
logs.Trace("This key %s cannot be processed,status is close", s.Password)
}
} else {
logs.Trace("This key %s cannot be processed", s.Password)