Skip to content

Commit f215939

Browse files
committed
Immediate: add alternative links and server uptime bot
1 parent f12fc9f commit f215939

5 files changed

Lines changed: 12 additions & 5 deletions

File tree

server-src/pinggy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { spawn } = require('node:child_process');
33
// Configuration
44
let serverPort = process.env.PORT || process.env.serverPort || 3000;
55
const filterLinks = ["https://dashboard.pinggy.io", "https://pinggy.io"];
6-
const maxPinggy = 10; // Total concurrent tunnels
6+
const maxPinggy = 25; // Total concurrent tunnels
77

88
const commandArgs = [
99
['ssh', [

server-src/server.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2883,9 +2883,14 @@ const server = http.createServer(async function (req, res) {
28832883
}
28842884

28852885
if (urlsplit[1] == "tunnels.json") {
2886+
res.setHeader("content-type", "application/json");
28862887
res.end(JSON.stringify(pinggy.getActiveAltLinks(), null, " "));
28872888
return;
28882889
}
2890+
if (urlsplit[1] == "sendtmp") {
2891+
res.end("Y");
2892+
return;
2893+
}
28892894

28902895
if (urlsplit[1] == "webpush" && WEBPUSH_ENABLED) {
28912896
if (urlsplit[2] == "key" && req.method == "GET") {

src/pages/alts.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async function showAltLinks(containerDiv) {
2929
textContent: "Loading...",
3030
},
3131
]);
32-
var tunnels = await getTunnels();
32+
var tunnels = await getTunnels();
3333
elements.setInnerJSON(
3434
containerDiv,
3535
tunnels.map((tunnel) => {
@@ -86,13 +86,14 @@ var randomRantsUpdates = [
8686
eventListeners: [
8787
{
8888
event: "click",
89-
func: () => showAltLinks,
89+
func: () => showAltLinks(elements.getGPId("containerDiv")),
9090
},
9191
],
9292
},
9393
{
9494
element: "div",
9595
GPWhenCreated: showAltLinks,
96+
gid: "containerDiv"
9697
},
9798
];
9899

webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ const pages = [
2727
"history",
2828
"legal",
2929
"credits",
30-
"updates"
30+
"updates",
31+
"alts"
3132
];
3233
const paths = pages.map((page) => {
3334
return {

wpstatic/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"timestamp":"1771435666891"}
1+
{"timestamp":"1771436033528"}

0 commit comments

Comments
 (0)