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
e9511eaf
Commit
e9511eaf
authored
Aug 01, 2010
by
Marak Squires
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated demo
parent
da55777a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
demo.js
demo.js
+15
-1
No files found.
demo.js
View file @
e9511eaf
...
...
@@ -51,10 +51,24 @@ httpProxy.createServer(function (req, res, proxy){
}).
listen
(
8001
);
sys
.
puts
(
'
http proxy server
'
.
blue
+
'
started
'
.
green
.
bold
+
'
on port
'
.
blue
+
'
8001
'
.
yellow
+
'
with latency
'
.
magenta
.
underline
);
// http proxy server with latency
http
.
createServer
(
function
(
req
,
res
){
setTimeout
(
function
(){
var
proxy
=
new
httpProxy
.
HttpProxy
;
proxy
.
watch
(
req
,
res
);
proxy
.
proxyRequest
(
'
localhost
'
,
9000
,
req
,
res
);
},
200
)
}).
listen
(
8002
);
sys
.
puts
(
'
http proxy server
'
.
blue
+
'
started
'
.
green
.
bold
+
'
on port
'
.
blue
+
'
8002
'
.
yellow
+
'
with latency
'
.
magenta
.
underline
);
// create regular http server
http
.
createServer
(
function
(
req
,
res
){
res
.
writeHead
(
200
,
{
'
Content-Type
'
:
'
text/plain
'
});
res
.
write
(
'
request successfully proxied
!
'
+
'
\n
'
+
JSON
.
stringify
(
req
.
headers
,
true
,
2
));
res
.
write
(
'
request successfully proxied
:
'
+
req
.
url
+
'
\n
'
+
JSON
.
stringify
(
req
.
headers
,
true
,
2
));
res
.
end
();
}).
listen
(
9000
);
sys
.
puts
(
'
http server
'
.
blue
+
'
started
'
.
green
.
bold
+
'
on port
'
.
blue
+
'
9000
'
.
yellow
);
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