mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-29 04:19:57 +00:00
TUN-4626: Proxy non-stream based origin websockets with http Roundtrip.
Reuses HTTPProxy's Roundtrip method to directly proxy websockets from eyeball clients (determined by websocket type and ingress not being connection oriented , i.e. Not ssh or smb for example) to proxy websocket traffic.
This commit is contained in:
@@ -571,8 +571,14 @@ func TestConnections(t *testing.T) {
|
||||
},
|
||||
},
|
||||
want: want{
|
||||
message: []byte{},
|
||||
err: true,
|
||||
message: []byte("Forbidden\n"),
|
||||
err: false,
|
||||
headers: map[string][]string{
|
||||
"Content-Length": {"10"},
|
||||
"Content-Type": {"text/plain; charset=utf-8"},
|
||||
"Sec-Websocket-Version": {"13"},
|
||||
"X-Content-Type-Options": {"nosniff"},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -806,6 +812,8 @@ func (w *wsRespWriter) WriteRespHeaders(status int, header http.Header) error {
|
||||
|
||||
// respHeaders is a test function to read respHeaders
|
||||
func (w *wsRespWriter) headers() http.Header {
|
||||
// Removing indeterminstic header because it cannot be asserted.
|
||||
w.responseHeaders.Del("Date")
|
||||
return w.responseHeaders
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user