Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
debomatic-webui
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
debomatic-webui-admins
debomatic-webui
Commits
b83015ca
Commit
b83015ca
authored
Jul 10, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update proxy libraries
parent
f0bedb18
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
110 additions
and
13 deletions
+110
-13
proxy/node_modules/http-proxy/examples/balancer/simple-balancer.js
...e_modules/http-proxy/examples/balancer/simple-balancer.js
+1
-1
proxy/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js
..._modules/http-proxy/lib/http-proxy/passes/web-incoming.js
+10
-2
proxy/node_modules/http-proxy/package.json
proxy/node_modules/http-proxy/package.json
+7
-3
proxy/node_modules/http-proxy/test/lib-http-proxy-passes-web-incoming-test.js
...ttp-proxy/test/lib-http-proxy-passes-web-incoming-test.js
+83
-2
proxy/node_modules/http-proxy/test/lib-http-proxy-test.js
proxy/node_modules/http-proxy/test/lib-http-proxy-test.js
+9
-5
No files found.
proxy/node_modules/http-proxy/examples/balancer/simple-balancer.js
View file @
b83015ca
...
...
@@ -58,7 +58,7 @@ http.createServer(function (req, res) {
//
// ...and then the server you just used becomes the last item in the list.
//
addresses
.
push
(
target
);
addresses
.
push
(
target
.
target
);
}).
listen
(
8021
);
// Rinse; repeat; enjoy.
\ No newline at end of file
proxy/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js
View file @
b83015ca
...
...
@@ -109,6 +109,14 @@ web_o = Object.keys(web_o).map(function(pass) {
common
.
setupOutgoing
(
options
.
ssl
||
{},
options
,
req
)
);
// allow outgoing socket to timeout so that we could
// show an error page at the initial request
if
(
options
.
proxyTimeout
)
{
proxyReq
.
setTimeout
(
options
.
proxyTimeout
,
function
()
{
proxyReq
.
abort
();
});
}
// Ensure we abort proxy if request is aborted
req
.
on
(
'
aborted
'
,
function
()
{
proxyReq
.
abort
();
...
...
@@ -122,9 +130,9 @@ web_o = Object.keys(web_o).map(function(pass) {
function
proxyError
(
err
){
if
(
clb
)
{
clb
(
err
,
req
,
res
);
clb
(
err
,
req
,
res
,
options
.
target
);
}
else
{
server
.
emit
(
'
error
'
,
err
,
req
,
res
);
server
.
emit
(
'
error
'
,
err
,
req
,
res
,
options
.
target
);
}
}
...
...
proxy/node_modules/http-proxy/package.json
View file @
b83015ca
{
"name"
:
"http-proxy"
,
"version"
:
"1.1.
4
"
,
"version"
:
"1.1.
5
"
,
"repository"
:
{
"type"
:
"git"
,
"url"
:
"https://github.com/nodejitsu/node-http-proxy.git"
...
...
@@ -50,6 +50,10 @@
"bugs"
:
{
"url"
:
"https://github.com/nodejitsu/node-http-proxy/issues"
},
"_id"
:
"http-proxy@1.1.4"
,
"_from"
:
"http-proxy@*"
"_id"
:
"http-proxy@1.1.5"
,
"dist"
:
{
"shasum"
:
"918a323d1f14677976670f557add4d00b43f2214"
},
"_from"
:
"http-proxy@*"
,
"_resolved"
:
"https://registry.npmjs.org/http-proxy/-/http-proxy-1.1.5.tgz"
}
proxy/node_modules/http-proxy/test/lib-http-proxy-passes-web-incoming-test.js
View file @
b83015ca
...
...
@@ -128,6 +128,87 @@ describe('#createProxyServer.web() using own http server', function () {
},
function
()
{}).
end
();
});
it
(
'
should proxy the request and handle timeout error (proxyTimeout)
'
,
function
(
done
)
{
var
proxy
=
httpProxy
.
createProxyServer
({
target
:
'
http://127.0.0.1:45000
'
,
proxyTimeout
:
100
});
require
(
'
net
'
).
createServer
().
listen
(
45000
);
var
proxyServer
=
http
.
createServer
(
requestHandler
);
var
started
=
new
Date
().
getTime
();
function
requestHandler
(
req
,
res
)
{
proxy
.
once
(
'
error
'
,
function
(
err
,
errReq
,
errRes
)
{
proxyServer
.
close
();
expect
(
err
).
to
.
be
.
an
(
Error
);
expect
(
errReq
).
to
.
be
.
equal
(
req
);
expect
(
errRes
).
to
.
be
.
equal
(
res
);
expect
(
new
Date
().
getTime
()
-
started
).
to
.
be
.
greaterThan
(
99
);
expect
(
err
.
code
).
to
.
be
(
'
ECONNRESET
'
);
done
();
});
proxy
.
web
(
req
,
res
);
}
proxyServer
.
listen
(
'
8084
'
);
http
.
request
({
hostname
:
'
127.0.0.1
'
,
port
:
'
8084
'
,
method
:
'
GET
'
,
},
function
()
{}).
end
();
});
it
(
'
should proxy the request and handle timeout error
'
,
function
(
done
)
{
var
proxy
=
httpProxy
.
createProxyServer
({
target
:
'
http://127.0.0.1:45001
'
,
timeout
:
100
});
require
(
'
net
'
).
createServer
().
listen
(
45001
);
var
proxyServer
=
http
.
createServer
(
requestHandler
);
var
cnt
=
0
;
var
doneOne
=
function
()
{
cnt
+=
1
;
if
(
cnt
===
2
)
done
();
}
var
started
=
new
Date
().
getTime
();
function
requestHandler
(
req
,
res
)
{
proxy
.
once
(
'
error
'
,
function
(
err
,
errReq
,
errRes
)
{
proxyServer
.
close
();
expect
(
err
).
to
.
be
.
an
(
Error
);
expect
(
errReq
).
to
.
be
.
equal
(
req
);
expect
(
errRes
).
to
.
be
.
equal
(
res
);
expect
(
err
.
code
).
to
.
be
(
'
ECONNRESET
'
);
doneOne
();
});
proxy
.
web
(
req
,
res
);
}
proxyServer
.
listen
(
'
8085
'
);
var
req
=
http
.
request
({
hostname
:
'
127.0.0.1
'
,
port
:
'
8085
'
,
method
:
'
GET
'
,
},
function
()
{});
req
.
on
(
'
error
'
,
function
(
err
)
{
expect
(
err
).
to
.
be
.
an
(
Error
);
expect
(
err
.
code
).
to
.
be
(
'
ECONNRESET
'
);
expect
(
new
Date
().
getTime
()
-
started
).
to
.
be
.
greaterThan
(
99
);
doneOne
();
});
req
.
end
();
});
it
(
'
should proxy the request and provide a proxyRes event with the request and response parameters
'
,
function
(
done
)
{
var
proxy
=
httpProxy
.
createProxyServer
({
target
:
'
http://127.0.0.1:8080
'
...
...
@@ -151,8 +232,8 @@ describe('#createProxyServer.web() using own http server', function () {
res
.
end
(
'
Response
'
);
});
proxyServer
.
listen
(
'
808
4
'
);
proxyServer
.
listen
(
'
808
6
'
);
source
.
listen
(
'
8080
'
);
http
.
request
(
'
http://127.0.0.1:808
4
'
,
function
()
{}).
end
();
http
.
request
(
'
http://127.0.0.1:808
6
'
,
function
()
{}).
end
();
});
});
\ No newline at end of file
proxy/node_modules/http-proxy/test/lib-http-proxy-test.js
View file @
b83015ca
...
...
@@ -294,9 +294,11 @@ describe('lib/http-proxy.js', function() {
var
proxy
=
httpProxy
.
createProxyServer
({
target
:
'
ws://127.0.0.1:
'
+
ports
.
source
,
ws
:
true
}),
proxyServer
=
proxy
.
listen
(
ports
.
proxy
),
destiny
=
io
.
listen
(
ports
.
source
,
function
()
{
});
proxyServer
=
proxy
.
listen
(
ports
.
proxy
);
var
server
=
http
.
createServer
();
destiny
=
io
.
listen
(
server
);
function
startSocketIo
()
{
var
client
=
ioClient
.
connect
(
'
ws://127.0.0.1:
'
+
ports
.
proxy
);
client
.
on
(
'
connect
'
,
function
()
{
...
...
@@ -306,10 +308,12 @@ describe('lib/http-proxy.js', function() {
client
.
on
(
'
outgoing
'
,
function
(
data
)
{
expect
(
data
).
to
.
be
(
'
Hello over websockets
'
);
proxyServer
.
_server
.
close
();
destiny
.
server
.
close
();
server
.
close
();
done
();
});
});
}
server
.
listen
(
ports
.
source
);
server
.
on
(
'
listening
'
,
startSocketIo
);
destiny
.
sockets
.
on
(
'
connection
'
,
function
(
socket
)
{
socket
.
on
(
'
incoming
'
,
function
(
msg
)
{
...
...
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