Skip to content

Commit 081c6f1

Browse files
committed
support proxy hosts now (i think idk reallly totally untested lol)
1 parent a579553 commit 081c6f1

7 files changed

Lines changed: 73 additions & 293 deletions

File tree

server/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const morgan = require("morgan");
88
console.log("STARTING");
99

1010
// load the client script in memory
11-
var clientScript = fs.readFileSync(path.join(__dirname, 'client.js'), 'utf8');
11+
var clientScript = fs.readFileSync(path.join(__dirname, '../', 'static/big_game_script.js'), 'utf8');
1212
var config = {
1313
prefix: "/p/",
1414
responseMiddleware: [
@@ -18,6 +18,7 @@ var config = {
1818
var unblocker = new Unblocker(config);
1919

2020
function injectScript(data) {
21+
return;
2122
console.log("INJECTING SCRIPT" + data.url);
2223
if (data.stream) {
2324
var injected = false;

static/assets/scripts/helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,4 +773,4 @@ async function enforceDonationLockout(goalAmount = 500) {
773773
console.error('Failed to check donation status:', err);
774774
}
775775
}
776-
enforceDonationLockout();
776+
// enforceDonationLockout();

static/cloud/index.html

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
6+
<meta http-equiv="Pragma" content="no-cache">
7+
<meta http-equiv="Expires" content="0">
8+
<meta charset="UTF-8">
9+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
10+
<script src="https://cdnjs.cloudflare.com/ajax/libs/aws-sdk/2.1502.0/aws-sdk.min.js"></script>
11+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css"
12+
integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg=="
13+
crossorigin="anonymous" referrerpolicy="no-referrer" />
14+
<meta name="description"
15+
content="Many games ported to different domains to prevent organization unblocking tools from blocking them. Cookie clicker, drift hunters, tiny fishing, spelunky, minecraft, slope, champion island, and NES games all unblocked.">
16+
<chead title="CCPorted"/>
17+
</head>
18+
19+
<body>
20+
<navigation />
21+
<div class="container">
22+
<h1>Cloud Gaming</h1>
23+
<div class="search">
24+
<input id="searchBox" placeholder="Search for a game...">
25+
<div class="action-button-row">
26+
<button class="toggle-btn" data-current="grid">
27+
<div class="dots-container">
28+
<div class="dot"></div>
29+
<div class="dot"></div>
30+
<div class="dot"></div>
31+
<div class="dot"></div>
32+
</div>
33+
</button>
34+
<button id="pickforme">Pick For Me</button>
35+
<button id="sort">Sort: <span id="order">Hot</span></button>
36+
</div>
37+
</div>
38+
<div class="subContainer">
39+
<div class="row">
40+
</div>
41+
</div>
42+
</div>
43+
<lightDarkToggle />
44+
<script src="/assets/scripts/cloud.js"></script>
45+
</body>
46+
47+
</html>

static/phosts.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ccported.click,proxy
1+
ccported.click,proxy,https

static/play/play.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,12 @@
145145
if (proxyHost) {
146146
// on proxy host
147147
console.log("Proxy host detected");
148-
const sub = proxyHost.split(",")[1].trim();
149148
const host = proxyHost.split(",")[0].trim();
150-
const path = proxyHost.split(",")[2].trim();
151-
const domain = `https://${sub}.${host}/${path}/${item.proxyPath}`
149+
const sub = proxyHost.split(",")[1].trim();
150+
const protocol = proxyHost.split(",")[2].trim();
151+
const domain = `${protocol}://${(sub.length > 0) ? sub + "." : ""}${host}?url=${item.proxyPath}`
152152
iframe.src = `${domain}`;
153+
window.serverToggle.enabled = false;
153154
} else {
154155
// not on proxy host
155156
console.log("Not a proxy host");

static/play/server-toggle.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ServerToggle {
1010
this.itemHeight = 60; // Height of each server item
1111
this.visibleItems = 5; // Number of visible items in the wheel
1212
this.switchCallback = switchCallback;
13-
13+
this.enabled = true;
1414
this.init();
1515
}
1616

@@ -87,6 +87,7 @@ class ServerToggle {
8787
}
8888

8989
createUI() {
90+
if (!this.enabled) return;
9091
// Create UI container
9192
this.uiElement = document.createElement('div');
9293
this.uiElement.className = 'server-toggle-wheel';
@@ -113,6 +114,7 @@ class ServerToggle {
113114
}
114115

115116
updateUI() {
117+
if (!this.enabled) return;
116118
if (!this.wheelElement) return;
117119

118120
// Clear current wheel
@@ -184,13 +186,15 @@ class ServerToggle {
184186
}
185187

186188
updateWheelPosition() {
189+
if (!this.enabled) return;
187190
if (!this.wheelElement) return;
188191

189192
// No need to set the transform here - each item has its own transform
190193
// based on its position relative to the current index
191194
}
192195

193196
showUI() {
197+
if (!this.enabled) return;
194198
if (!this.uiElement) return;
195199

196200
this.uiVisible = true;
@@ -199,23 +203,27 @@ class ServerToggle {
199203
}
200204

201205
hideUI() {
206+
if (!this.enabled) return;
202207
if (!this.uiElement) return;
203208

204209
this.uiVisible = false;
205210
this.uiElement.style.display = 'none';
206211
}
207212

208213
nextServer(hideUI = false) {
214+
if (!this.enabled) return;
209215
this.currentServerIndex = (this.currentServerIndex + 1) % this.servers.length;
210216
if (!hideUI) this.showUI();
211217
}
212218

213219
prevServer() {
220+
if (!this.enabled) return;
214221
this.currentServerIndex = (this.currentServerIndex - 1 + this.servers.length) % this.servers.length;
215222
this.showUI();
216223
}
217224

218225
setupKeyboardListeners() {
226+
if (!this.enabled) return;
219227
// Track if Ctrl key is pressed
220228
let ctrlPressed = false;
221229

0 commit comments

Comments
 (0)