Remove first byte wait when tcp catches all

This commit is contained in:
Julien Salleyron 2019-06-07 19:30:07 +02:00 committed by Traefiker Bot
parent 518a37e776
commit c1dc783512
5 changed files with 155 additions and 14 deletions

View file

@ -27,6 +27,11 @@ type Router struct {
func (r *Router) ServeTCP(conn net.Conn) {
// FIXME -- Check if ProxyProtocol changes the first bytes of the request
if r.catchAllNoTLS != nil && len(r.routingTable) == 0 && r.httpsHandler == nil {
r.catchAllNoTLS.ServeTCP(conn)
return
}
br := bufio.NewReader(conn)
serverName, tls, peeked := clientHelloServerName(br)
if !tls {