Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
http ... PARTY!
node-http-proxy
Commits
b304ffe4
Commit
b304ffe4
authored
9 years ago
by
Caio Quirino da Silva
Browse files
Options
Download
Email Patches
Plain Diff
Fix target server
The correct is to reach server using host header, not URL.
parent
268994ea
github/fork/caioquirino/patch-1
1 merge request
!945
Fix target server
Pipeline
#1331
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/http/reverse-proxy.js
+2
-1
examples/http/reverse-proxy.js
with
2 additions
and
1 deletion
+2
-1
examples/http/reverse-proxy.js
+
2
-
1
View file @
b304ffe4
...
...
@@ -32,7 +32,8 @@ var proxy = httpProxy.createServer();
var
server
=
http
.
createServer
(
function
(
req
,
res
)
{
util
.
puts
(
'
Receiving reverse proxy request for:
'
+
req
.
url
);
proxy
.
web
(
req
,
res
,
{
target
:
req
.
url
,
secure
:
false
});
var
destinationServer
=
"
http://
"
+
req
.
headers
.
host
;
proxy
.
web
(
req
,
res
,
{
target
:
destinationServer
,
secure
:
false
});
}).
listen
(
8213
);
server
.
on
(
'
connect
'
,
function
(
req
,
socket
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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
Menu
Explore
Projects
Groups
Snippets