1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-12-01 22:51:45 +02:00

Improve websocket support

This commit is contained in:
gyson
2019-03-22 17:19:38 -04:00
parent ca89bb833d
commit 978c0a33e4
3 changed files with 16 additions and 1 deletions

View File

@@ -4,6 +4,8 @@
package main
import (
"bufio"
"errors"
"fmt"
"io"
"net"
@@ -32,6 +34,14 @@ func (l *responseLogger) Header() http.Header {
return l.w.Header()
}
// Support Websocket
func (l *responseLogger) Hijack() (rwc net.Conn, buf *bufio.ReadWriter, err error) {
if hj, ok := l.w.(http.Hijacker); ok {
return hj.Hijack()
}
return nil, nil, errors.New("http.Hijacker is not available on writer")
}
// ExtractGAPMetadata extracts and removes GAP headers from the ResponseWriter's
// Header
func (l *responseLogger) ExtractGAPMetadata() {