Skip to content

Commit

Permalink
Fix websockets (#2747)
Browse files Browse the repository at this point in the history
Removed all custom websocket code, and instead backported default Go ReverseProxy code, which now supports websockets by default.
Websockets now use the same dialer, and transport, which makes it scale and configure way easier.

Fix #2708
  • Loading branch information
buger authored Dec 29, 2019
1 parent fc854e9 commit 8090ce9
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 235 deletions.
141 changes: 0 additions & 141 deletions gateway/handler_websocket.go

This file was deleted.

16 changes: 8 additions & 8 deletions gateway/proxy_muxer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,34 +182,34 @@ func TestCheckPortWhiteList(t *testing.T) {
}{
{"gw port empty protocol", "", base.ListenPort, true, nil},
{"gw port http protocol", "http", base.ListenPort, false, map[string]config.PortWhiteList{
"http": config.PortWhiteList{
"http": {
Ports: []int{base.ListenPort},
},
}},
{"unknown tls", "tls", base.ListenPort, true, nil},
{"unknown tcp", "tls", base.ListenPort, true, nil},
{"whitelisted tcp", "tcp", base.ListenPort, false, map[string]config.PortWhiteList{
"tcp": config.PortWhiteList{
"tcp": {
Ports: []int{base.ListenPort},
},
}},
{"whitelisted tls", "tls", base.ListenPort, false, map[string]config.PortWhiteList{
"tls": config.PortWhiteList{
"tls": {
Ports: []int{base.ListenPort},
},
}},
{"black listed tcp", "tcp", base.ListenPort, true, map[string]config.PortWhiteList{
"tls": config.PortWhiteList{
"tls": {
Ports: []int{base.ListenPort},
},
}},
{"blacklisted tls", "tls", base.ListenPort, true, map[string]config.PortWhiteList{
"tcp": config.PortWhiteList{
"tcp": {
Ports: []int{base.ListenPort},
},
}},
{"whitelisted tls range", "tls", base.ListenPort, false, map[string]config.PortWhiteList{
"tls": config.PortWhiteList{
"tls": {
Ranges: []config.PortRange{
{
From: base.ListenPort - 1,
Expand All @@ -219,7 +219,7 @@ func TestCheckPortWhiteList(t *testing.T) {
},
}},
{"whitelisted tcp range", "tcp", base.ListenPort, false, map[string]config.PortWhiteList{
"tcp": config.PortWhiteList{
"tcp": {
Ranges: []config.PortRange{
{
From: base.ListenPort - 1,
Expand All @@ -229,7 +229,7 @@ func TestCheckPortWhiteList(t *testing.T) {
},
}},
{"whitelisted http range", "http", 8090, false, map[string]config.PortWhiteList{
"http": config.PortWhiteList{
"http": {
Ranges: []config.PortRange{
{
From: 8000,
Expand Down
Loading

0 comments on commit 8090ce9

Please sign in to comment.