Add client abridged protocol

This commit is contained in:
9seconds
2019-10-10 07:22:08 +03:00
parent 1a7eee444e
commit e81c5970d4
32 changed files with 538 additions and 174 deletions
+4 -4
View File
@@ -14,7 +14,7 @@ import (
"github.com/9seconds/mtg/protocol"
"github.com/9seconds/mtg/stats"
"github.com/9seconds/mtg/utils"
"github.com/9seconds/mtg/wrappers"
"github.com/9seconds/mtg/wrappers/stream"
)
const directPipeBufferSize = 1024 * 1024
@@ -63,9 +63,9 @@ func (p *Proxy) accept(conn net.Conn) {
ctx, cancel := context.WithCancel(p.Context)
defer cancel()
clientConn := wrappers.NewClientConn(conn, connID)
clientConn = wrappers.NewCtx(ctx, cancel, clientConn)
clientConn = wrappers.NewTimeout(clientConn)
clientConn := stream.NewClientConn(conn, connID)
clientConn = stream.NewCtx(ctx, cancel, clientConn)
clientConn = stream.NewTimeout(clientConn)
defer clientConn.Close()
clientProtocol := p.ClientProtocolMaker()