Skip to content

Commit

Permalink
Changed bare-server-node to another one
Browse files Browse the repository at this point in the history
  • Loading branch information
dave9123 committed Dec 18, 2024
1 parent 7f481ca commit 3123cb5
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 43 deletions.
2 changes: 1 addition & 1 deletion bare.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import http from 'node:http';
import { createBareServer } from '@tomphttp/bare-server-node';
import { createBareServer } from '@nebula-services/bare-server-node';

const httpServer = http.createServer();

Expand Down
17 changes: 8 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { createBareServer } from '@nebula-services/bare-server-node';
import { createBareServer } from "@nebula-services/bare-server-node";
import wisp from "wisp-server-node";
import express from "express";
import { createServer } from "node:http";
import { SocksProxyAgent } from 'socks-proxy-agent';
const socksProxyAgent = new SocksProxyAgent('socks://localhost:40000');
import { SocksProxyAgent } from "socks-proxy-agent";
const socksProxyAgent = new SocksProxyAgent("socks://localhost:40000");
import { uvPath } from "@titaniumnetwork-dev/ultraviolet";
import { join } from "node:path";
import { hostname } from "node:os";
import dotenv from 'dotenv';
import dotenv from "dotenv";
import { fileURLToPath } from "url";
const publicPath = fileURLToPath(new URL("./static/", import.meta.url));
const bare = createBareServer('/bare/', {});
const bare = createBareServer("/bare/", {});
const app = express();
dotenv.config();
app.use(express.static(publicPath));
Expand All @@ -27,12 +26,12 @@ server.on("upgrade", (req, socket, head) => {
if (bare.shouldRoute(req)) {
bare.routeUpgrade(req, socket, head);
} else {
socket.end();
wisp.routeRequest(req, socket, head);
}
});
const port = process.env.PORT || 3300;
server.on("listening", () => {
console.log('UP')
console.log(`UP http://localhost:${port}`);
});

server.listen({
Expand Down
62 changes: 32 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
{
"name": "astroid-v3",
"version": "3.1",
"description": "Astroid, a proxy that supports now.gg and uses Ultraviolet, a highly sophisticated proxy used for evading internet censorship or accessing websites in a controlled sandbox using the power of service-workers and more!",
"type": "module",
"engines": {
"npm": ">=7.0.0",
"node": ">=16.0.0"
},
"scripts": {
"start": "node index.js"
},
"keywords": [
"math"
],
"author": "",
"license": "GPL-3.0-or-later",
"dependencies": {
"@nebula-services/bare-server-node": "^2.0.4",
"@titaniumnetwork-dev/ultraviolet": "^1.0.11",
"@tomphttp/bare-server-node": "^2.0.1",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"socks-proxy-agent": "^8.0.2"
},
"devDependencies": {
"eslint": "^9.6.0",
"prettier": "^3.0.3"
}
}
{
"name": "astroid-v3",
"version": "3.1",
"description": "Astroid, a proxy that supports now.gg and uses Ultraviolet, a highly sophisticated proxy used for evading internet censorship or accessing websites in a controlled sandbox using the power of service-workers and more!",
"type": "module",
"engines": {
"npm": ">=7.0.0",
"node": ">=16.0.0"
},
"scripts": {
"start": "bun index.js",
"genPackageLock": "npm i --package-lock-only"
},
"keywords": [
"math"
],
"author": "",
"license": "GPL-3.0-or-later",
"dependencies": {
"@nebula-services/bare-server-node": "^2.0.4",
"@titaniumnetwork-dev/ultraviolet": "^3.2.10",
"@tomphttp/bare-server-node": "^2.0.1",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"socks-proxy-agent": "^8.0.2",
"wisp-server-node": "^1.1.7"
},
"devDependencies": {
"eslint": "^9.6.0",
"prettier": "^3.0.3"
}
}
Binary file added static/favicon.ico
Binary file not shown.
1 change: 0 additions & 1 deletion static/worksheets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<head>
<meta charset="utf-8">
<title>Math Is Fun</title>
<link rel="icon" type="image/png" href="assets/logo.png">
<meta name="description" content="Mathematics, Simplified.">
<meta name="author" content="Math Is Fun" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
Expand Down
3 changes: 1 addition & 2 deletions static/worksheets/loader.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<meta content="#ffffff" data-react-helmet="true" name="theme-color">
<meta property="og:image" content="assets/images/logo.png">
<title>Math Is Fun</title>
<link rel="icon" type="image/x-icon" href="assets/images/favicon.png">
<link rel="stylesheet" href="https://fonts.cdnfonts.com/css/rawline">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;500;600;700;800&display=swap">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap">
Expand Down Expand Up @@ -44,7 +43,7 @@
<a href="nowgg.html" class="navbar__item">Now.gg</a>
<a href="html.html" class="navbar__item">HTML / Flash</a>
<a href="emuindex.html" class="navbar__item">Emulators</a>
<a href="apps.html" class "navbar__item">Apps</a>
<a href="apps.html" class="navbar__item">Apps</a>
<a href="search.html" class="navbar__item">Search</a>
<a href="settings.html" class="navbar__item">Settings</a>
<a href="https://discord.gg/9sUDHyGQfC" target="_blank" class="navbar__item navbar__item--highlighted">Discord</a>
Expand Down

0 comments on commit 3123cb5

Please sign in to comment.