Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
MyBooty165 authored Feb 9, 2024
1 parent e21ca5c commit 760ccea
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const express = require('express');
const path = require('path');
const cluster = require('cluster');
const numCPUs = require('os').cpus().length;
const url = require('url');

if (cluster.isMaster) {
console.log(`Slave ${process.pid} is running`);
Expand All @@ -20,17 +19,16 @@ if (cluster.isMaster) {
} else {
const app = express();

const targetUrl = 'https://now.gg';
const nggurl = 'https://educationbluesky.com';

const proxy = httpProxy.createProxyServer({
target: targetUrl,
target: nggurl,
changeOrigin: true,
});

app.use('/', (req, res) => {
const target = url.resolve(targetUrl, req.url);
console.log(`Requests: ${req.url} - CYGGed to: ${target}`);
proxy.web(req, res, { target });
console.log(`Incoming Requests: ${req.url}`);
proxy.web(req, res);
});

app.use((req, res, next) => {
Expand Down

0 comments on commit 760ccea

Please sign in to comment.