Skip to content

Commit

Permalink
workaround for webkit websocket compression bug (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahlevenson committed Dec 2, 2022
1 parent 0f60fc8 commit adb7c82
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion egress/egress.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,17 @@ func (l proxyListener) Addr() net.Addr {
func (l proxyListener) handleWebsocket(w http.ResponseWriter, r *http.Request) {
// TODO: InsecureSkipVerify=true just disables origin checking, we need to instead add origin
// patterns as strings using AcceptOptions.OriginPattern
c, err := websocket.Accept(w, r, &websocket.AcceptOptions{InsecureSkipVerify: true})
// TODO: disabling compression is a workaround for a WebKit bug:
// https://github.com/getlantern/broflake/issues/45
c, err := websocket.Accept(
w,
r,
&websocket.AcceptOptions{
InsecureSkipVerify: true,
CompressionMode: websocket.CompressionDisabled,
},
)

if err != nil {
// TODO: this is the idiom for our WebSocket library, but we should log the err better
fmt.Println(err)
Expand Down

0 comments on commit adb7c82

Please sign in to comment.