Add support for HTTPupgrade custom headers

This commit is contained in:
风扇滑翔翼 2024-03-23 17:43:07 +00:00 committed by yuhan6665
parent bd38578978
commit 9a619f9e7c
4 changed files with 55 additions and 30 deletions

View file

@ -73,6 +73,9 @@ func dialhttpUpgrade(ctx context.Context, dest net.Destination, streamSettings *
Host: transportConfiguration.Host,
Header: make(http.Header),
}
for key, value := range transportConfiguration.Header {
req.Header.Add(key, value)
}
req.Header.Set("Connection", "upgrade")
req.Header.Set("Upgrade", "websocket")