Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
node-http-proxy
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
node-http-proxy
Commits
0c71119e
Commit
0c71119e
authored
Sep 08, 2011
by
indexzero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resume() can throw
parent
37e25418
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
lib/node-http-proxy/http-proxy.js
lib/node-http-proxy/http-proxy.js
+13
-7
No files found.
lib/node-http-proxy/http-proxy.js
View file @
0c71119e
...
...
@@ -238,7 +238,8 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
if
(
!
flushed
)
{
response
.
pause
();
res
.
once
(
'
drain
'
,
function
()
{
response
.
resume
();
try
{
response
.
resume
()
}
catch
(
er
)
{
console
.
error
(
"
response.resume error: %s
"
,
er
.
message
)
}
});
//
...
...
@@ -287,7 +288,8 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
if
(
!
flushed
)
{
req
.
pause
();
reverseProxy
.
once
(
'
drain
'
,
function
()
{
req
.
resume
();
try
{
req
.
resume
()
}
catch
(
er
)
{
console
.
error
(
"
req.resume error: %s
"
,
er
.
message
)
}
});
//
...
...
@@ -370,7 +372,8 @@ HttpProxy.prototype._forwardRequest = function (req) {
if
(
!
flushed
)
{
req
.
pause
();
forwardProxy
.
once
(
'
drain
'
,
function
()
{
req
.
resume
();
try
{
req
.
resume
()
}
catch
(
er
)
{
console
.
error
(
"
req.resume error: %s
"
,
er
.
message
)
}
});
//
...
...
@@ -470,7 +473,8 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
if
(
!
flushed
)
{
proxySocket
.
pause
();
reverseProxy
.
incoming
.
socket
.
once
(
'
drain
'
,
function
()
{
proxySocket
.
resume
();
try
{
proxySocket
.
resume
()
}
catch
(
er
)
{
console
.
error
(
"
proxySocket.resume error: %s
"
,
er
.
message
)
}
});
//
...
...
@@ -501,7 +505,8 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
if
(
!
flushed
)
{
reverseProxy
.
incoming
.
socket
.
pause
();
proxySocket
.
once
(
'
drain
'
,
function
()
{
reverseProxy
.
incoming
.
socket
.
resume
();
try
{
reverseProxy
.
incoming
.
socket
.
resume
()
}
catch
(
er
)
{
console
.
error
(
"
reverseProxy.incoming.socket.resume error: %s
"
,
er
.
message
)
}
});
//
...
...
@@ -619,7 +624,7 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
// This will force us not to disconnect.
//
// In addition, it's important to note the closure scope here. Since
// there is no mapping of the
// there is no mapping of the
socket to the request bound to it.
//
if
(
!
agent
.
_events
||
agent
.
_events
[
'
upgrade
'
].
length
===
0
)
{
agent
.
on
(
'
upgrade
'
,
function
(
_
,
remoteSocket
,
head
)
{
...
...
@@ -673,7 +678,8 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
if
(
!
flushed
)
{
reverseProxy
.
socket
.
pause
();
socket
.
once
(
'
drain
'
,
function
()
{
reverseProxy
.
socket
.
resume
();
try
{
reverseProxy
.
socket
.
resume
()
}
catch
(
er
)
{
console
.
error
(
"
reverseProxy.socket.resume error: %s
"
,
er
.
message
)
}
});
//
...
...
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