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
3140ce42
Commit
3140ce42
authored
3 years ago
by
Gunananthaa K B
Browse files
Options
Downloads
Patches
Plain Diff
basic working proxy
parent
8853e8a9
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
server/contents/index.html
+6
-1
6 additions, 1 deletion
server/contents/index.html
server/server.js
+6
-2
6 additions, 2 deletions
server/server.js
with
12 additions
and
3 deletions
server/contents/index.html
+
6
−
1
View file @
3140ce42
...
...
@@ -5,8 +5,13 @@
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
Web Serving content
</title>
<style>
#top-head
{
text-align
:
center
;
}
</style>
</head>
<body>
<h1
id=
"top-head"
>
Web content served by the Proxy!
</h1>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
server/server.js
+
6
−
2
View file @
3140ce42
const
http
=
require
(
'
http
'
);
const
fs
=
require
(
'
fs
'
).
promises
;
const
PORT
=
3000
;
const
requestListener
=
(
req
,
res
)
=>
{
fs
.
readFile
(
'
./contents/index.html
'
).
then
(
contents
=>
{
res
.
setHeader
(
"
Content-Type
"
,
"
text/html
"
);
res
.
writeHead
(
200
);
res
.
end
(
contents
);
});
console
.
log
(
req
.
headers
);
res
.
end
(
"
hello
"
);
}
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