Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
acn-web-proxy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gunananthaa K B
acn-web-proxy
Commits
7fc1ca73
Commit
7fc1ca73
authored
3 years ago
by
Gunananthaa K B
Browse files
Options
Downloads
Patches
Plain Diff
basic working proxy
parent
3140ce42
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
proxy/proxy.js
+19
-3
19 additions, 3 deletions
proxy/proxy.js
with
19 additions
and
3 deletions
proxy/proxy.js
+
19
−
3
View file @
7fc1ca73
const
http
=
require
(
'
http
'
);
const
http
=
require
(
'
http
'
);
const
PORT
=
300
0
;
const
PORT
=
808
0
;
const
requestListener
=
(
req
,
res
)
=>
{
const
requestListener
=
(
req
,
res
)
=>
{
const
options
=
{
hostname
:
'
localhost
'
,
port
:
3000
,
path
:
'
/
'
};
const
get
=
http
.
get
(
options
,
response
=>
{
console
.
log
(
`statusCode:
${
response
.
statusCode
}
`
);
let
buffer
=
""
;
response
.
on
(
'
data
'
,
d
=>
{
buffer
+=
d
});
response
.
on
(
'
error
'
,
err
=>
{
console
.
log
(
`error:
${
err
}
`
)});
response
.
on
(
'
end
'
,()
=>
{
res
.
setHeader
(
"
Content-Type
"
,
"
text/html
"
);
res
.
writeHead
(
200
);
res
.
writeHead
(
200
);
res
.
end
(
buffer
);
});
})
// res.writeHead(200);
console
.
log
(
req
.
headers
);
console
.
log
(
req
.
headers
);
res
.
end
(
"
hello
"
);
//
res.end("hello");
}
}
const
server
=
http
.
createServer
(
requestListener
);
const
server
=
http
.
createServer
(
requestListener
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment