diff --git a/bare.mjs b/bare.mjs index 605c3b6..50bee3e 100644 --- a/bare.mjs +++ b/bare.mjs @@ -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(); diff --git a/index.js b/index.js index b69c738..ffbd79a 100644 --- a/index.js +++ b/index.js @@ -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)); @@ -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({ diff --git a/package.json b/package.json index b997a0d..a09c7e2 100644 --- a/package.json +++ b/package.json @@ -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" + } +} diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000..62fb12c Binary files /dev/null and b/static/favicon.ico differ diff --git a/static/worksheets/index.html b/static/worksheets/index.html index 0c2652b..044dcb0 100644 --- a/static/worksheets/index.html +++ b/static/worksheets/index.html @@ -3,7 +3,6 @@