1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 05:56:54 -05:00

Fix reverse proxy with the HTTP optimization

And any other protocol that require the connection initializer to send first, E.g. freedom with TFO.
This commit is contained in:
Anonymous-Someneese 2020-01-05 07:11:54 +08:00 committed by kslr
parent a5caa01cb6
commit 82dee01833

View File

@ -7,6 +7,7 @@ import (
"time"
"github.com/golang/protobuf/proto"
"v2ray.com/core/common/buf"
"v2ray.com/core/common/mux"
"v2ray.com/core/common/net"
"v2ray.com/core/common/session"
@ -119,6 +120,13 @@ func NewBridgeWorker(domain string, tag string, d routing.Dispatcher) (*BridgeWo
tag: tag,
}
// Initialize the connection by sending a Keepalive frame
keepalive := buf.New()
mux.FrameMetadata{SessionStatus: mux.SessionStatusKeepAlive}.WriteTo(keepalive)
err = link.Writer.WriteMultiBuffer(buf.MultiBuffer{keepalive})
if err != nil {
return nil, err
}
worker, err := mux.NewServerWorker(context.Background(), w, link)
if err != nil {
return nil, err