Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoryammilwalrus committed Sep 22, 2022
1 parent 238c313 commit da28ffd
Show file tree
Hide file tree
Showing 16 changed files with 361 additions and 238 deletions.
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ blank_issues_enabled: false
contact_links:
- name: Don't see your issue here?
url: https://discord.gg/J3VPy5Vy8x
about: Join our discord for help and more support
about: Join our discord for help and more support
- name: Heroku, Repl.it, Blocked site issues
url: https://www.youtube.com/embed/BLUkgRAy_Vo?mute=1&autoplay=1
about: Do not create issues for these.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
node_modules
.junk
node_modules
6 changes: 3 additions & 3 deletions .replit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
entrypoint = "README.md"
run = "./repl.sh"
onBoot = "chmod u+x repl.sh && chmod u+x webretro.sh"
language = "nodejs"
language = "nodejs"
run = ["npm", "start"]
onBoot = "chmod u+x webretro.sh"
File renamed without changes.
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
- [Features](#features)
- [FAQ](#faq)
- [More](#more)
- [Proxy Sources](#proxy-sources)
- [Credits](#credits)
- [Credits](#credits)


## Features
Expand All @@ -67,14 +66,8 @@ This repo is for people that want a easy way to deploy Incognito to cloud hostin

**My question is not answered**

Because we can't answer every question here, you may want to check the [wiki](https://github.com/IDontCodee/Incognito/wiki). If you still have questions, you might want to join our Discord [(link above)](#discord-server)
Because we can't answer every question here, you may want to check the [wiki](https://github.com/IDontCodee/Incognito/wiki). If you still have questions, you might want to join our Discord [#discord-server](#discord-server)

## More
## Credits

### Proxy Sources

[Ultraviolet](https://github.com/titaniumnetwork-dev/Ultraviolet)

### Credits

[Caracal.js](https://github.com/caracal-js) - Creator of Incognito
[Caracal.js](https://github.com/caracal-js) - Creator of Incognito
43 changes: 40 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
(async() => {
await import('./index.mjs');
})();
import createServer from '@tomphttp/bare-server-node';
import { fileURLToPath } from "url";
import http from 'http';
import serveStatic from "serve-static";

// 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")

const port = process.env.PORT || 8080;
const bare = createServer('/bare/');
const serve = serveStatic(fileURLToPath(new URL("./static/", import.meta.url)), { fallthrough: false });
const server = http.createServer();

server.on('request', (req, res) => {
if (bare.shouldRoute(req)) {
bare.routeRequest(req, res);
} else {
serve(req, res, (err) => {
res.writeHead(err?.statusCode || 500, null, {
"Content-Type": "text/plain",
});
res.end(err?.stack);
});
}
});

server.on('upgrade', (req, socket, head) => {
if (bare.shouldRoute(req, socket, head)) {
bare.routeUpgrade(req, socket, head);
} else {
socket.end();
}
});


server.listen({
port: port,
});

console.log("Server running on port " + port)
24 changes: 0 additions & 24 deletions index.mjs

This file was deleted.

Loading

0 comments on commit da28ffd

Please sign in to comment.