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
cf39e55a
Commit
cf39e55a
authored
Sep 10, 2011
by
indexzero
Committed by
Cédric de Saint Martin
Jan 03, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[refactor] Updates to support http2 from @mikeal
Conflicts: lib/node-http-proxy/http-proxy.js
parent
54c2a61b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
lib/node-http-proxy/http-proxy.js
lib/node-http-proxy/http-proxy.js
+11
-12
No files found.
lib/node-http-proxy/http-proxy.js
View file @
cf39e55a
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
*/
*/
var
events
=
require
(
'
events
'
),
var
events
=
require
(
'
events
'
),
http
=
require
(
'
http
'
),
util
=
require
(
'
util
'
),
util
=
require
(
'
util
'
),
httpProxy
=
require
(
'
../node-http-proxy
'
);
httpProxy
=
require
(
'
../node-http-proxy
'
);
...
@@ -603,6 +604,7 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
...
@@ -603,6 +604,7 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
outgoing
.
method
=
'
GET
'
;
outgoing
.
method
=
'
GET
'
;
outgoing
.
path
=
req
.
url
;
outgoing
.
path
=
req
.
url
;
outgoing
.
headers
=
req
.
headers
;
outgoing
.
headers
=
req
.
headers
;
outgoing
.
agent
=
agent
;
var
reverseProxy
=
this
.
target
.
protocol
.
request
(
outgoing
);
var
reverseProxy
=
this
.
target
.
protocol
.
request
(
outgoing
);
...
@@ -626,7 +628,6 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
...
@@ -626,7 +628,6 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
// available to the `upgrade` event. This bookkeeping is not tracked anywhere
// available to the `upgrade` event. This bookkeeping is not tracked anywhere
// in nodejs core and is **very** specific to proxying WebSockets.
// in nodejs core and is **very** specific to proxying WebSockets.
//
//
reverseProxy
.
agent
=
agent
;
reverseProxy
.
incoming
=
{
reverseProxy
.
incoming
=
{
request
:
req
,
request
:
req
,
socket
:
socket
,
socket
:
socket
,
...
@@ -641,8 +642,7 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
...
@@ -641,8 +642,7 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
// In addition, it's important to note the closure scope here. Since
// In addition, it's important to note the closure scope here. Since
// there is no mapping of the socket to the request bound to it.
// there is no mapping of the socket to the request bound to it.
//
//
if
(
!
agent
.
_events
||
agent
.
_events
[
'
upgrade
'
].
length
===
0
)
{
reverseProxy
.
on
(
'
upgrade
'
,
function
(
_
,
remoteSocket
,
head
)
{
agent
.
on
(
'
upgrade
'
,
function
(
_
,
remoteSocket
,
head
)
{
//
//
// Prepare the socket for the reverseProxy request and begin to
// Prepare the socket for the reverseProxy request and begin to
// stream data between the two sockets. Here it is important to
// stream data between the two sockets. Here it is important to
...
@@ -651,7 +651,6 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
...
@@ -651,7 +651,6 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
_socket
(
remoteSocket
,
true
);
_socket
(
remoteSocket
,
true
);
onUpgrade
(
remoteSocket
.
_httpMessage
,
remoteSocket
);
onUpgrade
(
remoteSocket
.
_httpMessage
,
remoteSocket
);
});
});
}
//
//
// If the reverseProxy connection has an underlying socket,
// If the reverseProxy connection has an underlying socket,
...
...
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