forked from amethystnetwork-dev/Incognito
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d019c6
commit 2b20a4e
Showing
24 changed files
with
641 additions
and
355 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
node_modules | ||
node_modules | ||
ssl/cert.* | ||
ssl/key.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "Incognito", | ||
"description": "Unofficial Incognito easy deployment version with TompHTTP bare server included.", | ||
"repository": "https://github.com/IDontCodee/Incognito", | ||
"logo": "https://github.com/IDontCodee/Incognito/blob/main/static/index.svg?raw=true", | ||
"keywords": ["unoffical", "ultraviolet", "unblock", "titaniumnetwork", "bypass-filter"] | ||
"repository": "https://github.com/amethystnetwork-dev/Incognito", | ||
"logo": "https://github.com/amethystnetwork-dev/Incognito/blob/main/static/index.svg?raw=true", | ||
"keywords": ["unoffical", "ultraviolet", "unblock", "titaniumnetwork", "bypass-filter", "amethystnetwork-dev"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
services: | ||
- type: web | ||
name: incognito | ||
env: node | ||
buildCommand: npm install | ||
startCommand: npm start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import createServer from '@tomphttp/bare-server-node'; | ||
import { fileURLToPath } from "url"; | ||
import https from "node:https"; | ||
import { readFileSync, existsSync } from "node:fs"; | ||
import serveStatic from "serve-static"; | ||
import analytics from './analytics.js'; | ||
|
||
// The following message MAY NOT be removed | ||
console.log("Incognito\nThis program comes with ABSOLUTELY NO WARRANTY.\nThis is free software, and you are welcome to redistribute it\nunder the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see <https://www.gnu.org/licenses/>.\n"); | ||
|
||
var data = { live: 0, peak: 0, visits: 0 } | ||
const bare = createServer("/bare/"); | ||
const serve = serveStatic(fileURLToPath(new URL("../static/", import.meta.url)), { fallthrough: false }); | ||
var ssl = {}; | ||
if(existsSync("../ssl/key.pem") && existsSync("../ssl/cert.pem")) ssl = { | ||
key: readFileSync("../ssl/key.pem"), | ||
cert: readFileSync("../ssl/cert.pem") | ||
}; | ||
|
||
const server = https.createServer(ssl); | ||
|
||
server.on("request", (req, res) => { | ||
if(bare.shouldRoute(req)) bare.routeRequest(req, res); else { | ||
if(req.url.startsWith("/data")) { | ||
analytics(req, res, data) | ||
} else { | ||
serve(req, res, (err) => { | ||
res.writeHead(err?.statusCode || 500, null, { | ||
"Content-Type": "text/plain", | ||
}); | ||
res.end('Error') | ||
}) | ||
}} | ||
}); | ||
|
||
server.on("upgrade", (req, socket, head) => { | ||
if(bare.shouldRoute(req, socket, head)) bare.routeUpgrade(req, socket, head); else socket.end(); | ||
}); | ||
|
||
server.on('listening', () => { | ||
const addr = server.address(); | ||
|
||
console.log(`Server running on port ${addr.port}`) | ||
console.log(''); | ||
console.log('You can now view it in your browser.') | ||
/* Code for listing IPS from website-aio */ | ||
console.log(`Local: http://${addr.family === 'IPv6' ? `[${addr.address}]` : addr.address}:${addr.port}`); | ||
try { console.log(`On Your Network: http://${address.ip()}:${addr.port}`); } catch (err) {/* Can't find LAN interface */}; | ||
if(process.env.REPL_SLUG && process.env.REPL_OWNER) console.log(`Replit: https://${process.env.REPL_SLUG}.${process.env.REPL_OWNER}.repl.co`); | ||
}); | ||
|
||
server.listen({ port: (process.env.PORT || 8080) }) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# SSL config | ||
|
||
To enable SSL when using a provider that does not provide them, place your certificates in the SSL folder. | ||
|
||
The certificate should be named `cert.pem` and the private key named `key.pem` |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.