Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
caddy
Commits
1fb66d53
Commit
1fb66d53
authored
Nov 21, 2015
by
Luit van Drongelen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Close proxy's backend request earlier when re-connecting for websocket
parent
f0b1edaf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
middleware/proxy/reverseproxy.go
middleware/proxy/reverseproxy.go
+2
-1
No files found.
middleware/proxy/reverseproxy.go
View file @
1fb66d53
...
...
@@ -155,9 +155,9 @@ func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request, extr
if
err
!=
nil
{
return
err
}
defer
res
.
Body
.
Close
()
if
res
.
StatusCode
==
http
.
StatusSwitchingProtocols
&&
res
.
Header
.
Get
(
"Upgrade"
)
==
"websocket"
{
res
.
Body
.
Close
()
hj
,
ok
:=
rw
.
(
http
.
Hijacker
)
if
!
ok
{
return
nil
...
...
@@ -182,6 +182,7 @@ func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request, extr
}()
io
.
Copy
(
conn
,
backendConn
)
// read tcp stream from backend.
}
else
{
defer
res
.
Body
.
Close
()
for
_
,
h
:=
range
hopHeaders
{
res
.
Header
.
Del
(
h
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment