From 2fc5cf5e69b78ea914a82f6be4d9c9effea2b042 Mon Sep 17 00:00:00 2001 From: Henry Camacho Date: Sat, 11 Mar 2017 08:28:04 -0600 Subject: [PATCH] =?UTF-8?q?SNI=20Detection=20working,=20sets=20=E2=80=98HT?= =?UTF-8?q?TPS=E2=80=99=20for=20packer=20for=20external=20connections?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rvpn/genericlistener/listener_generic.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rvpn/genericlistener/listener_generic.go b/rvpn/genericlistener/listener_generic.go index 7cefc7a..16c1418 100644 --- a/rvpn/genericlistener/listener_generic.go +++ b/rvpn/genericlistener/listener_generic.go @@ -171,7 +171,7 @@ func handleConnection(ctx context.Context, wConn *WedgeConn) { if wssHostName != sniHostName { //traffic not terminating on the rvpn do not decrypt loginfo.Println("processing non terminating traffic") - handleExternalHTTPRequest(ctx, wConn, sniHostName) + handleExternalHTTPRequest(ctx, wConn, sniHostName, "https") } loginfo.Println("processing traffic terminating on RVPN") @@ -257,7 +257,7 @@ func handleStream(ctx context.Context, wConn *WedgeConn) { //handleExternalHTTPRequest - // - get a wConn and start processing requests -func handleExternalHTTPRequest(ctx context.Context, extConn net.Conn, hostname string) { +func handleExternalHTTPRequest(ctx context.Context, extConn net.Conn, hostname string, service string) { connectionTracking := ctx.Value(ctxConnectionTrack).(*Tracking) defer func() { @@ -286,7 +286,7 @@ func handleExternalHTTPRequest(ctx context.Context, extConn net.Conn, hostname s return } - var buffer [512]byte + var buffer [1024]byte for { cnt, err := extConn.Read(buffer[0:]) if err != nil { @@ -301,7 +301,7 @@ func handleExternalHTTPRequest(ctx context.Context, extConn net.Conn, hostname s return } - p.Header.Service = "http" + p.Header.Service = service p.Data.AppendBytes(buffer[0:cnt]) buf := p.PackV1()