mhmdrza/docker
0
1import httpProxy from 'http-proxy';
2// import http from 'http';
3
4const PORT = process.env.PORT || 7860;
5const DOMAIN = 'https://youtube.com'
6//
7// Create your proxy server and set the target in the options.
8//
9
10// httpProxy.createProxyServer({
11// target:'http://' + DOMAIN,
12// }).listen(PORT);
13
14httpProxy.createProxyServer({
15 target: DOMAIN,
16 // secure: true,
17 autoRewrite: true,
18 hostRewrite: true,
19 changeOrigin: true,
20 ws: true,
21 followRedirects: true,
22}).listen(PORT);
23
24// http.createServer(function (req, res) {
25// res.writeHead(200, { 'Content-Type': 'text/plain' });
26// res.write('request successfully proxied!' + '\n' + JSON.stringify(req.headers, true, 2));
27// res.end();
28// }).listen(9000);