├── .gitignore
├── README.md
├── app.json
├── package.json
├── document.html
├── index.html
├── proxytown.js
└── bootstrap.js
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ProxyTown
2 | Well, you know, ponytown code is very bullshit and we need to proxy it for fuuun.
3 |
4 | Ok first type
5 |
6 | npm install
7 | Done? well after than then type
8 |
9 | npm start.
10 | That's fucking it!
11 |
12 |
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "PonyTown",
3 | "description": "PonyTown server that we never managed to complete",
4 | "repository": "https://github.com/RainbowDangerDash/PT",
5 | "logo": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRaSbbq3h70vt68GdzIrcbhJnN1mpoZ4sDdwwfv5ec4N2cPmtWE",
6 | "keywords": ["mlp"],
7 | "image": "heroku/nodejs"
8 | }
9 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "proxytown",
3 | "version": "0.0.1",
4 | "description": " \"A proxy for ponytown, so we can actually read this piece of shit code\"",
5 | "main": "proxytown.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "start": "node proxytown"
9 | },
10 | "repository": {
11 | "type": "git",
12 | "url": "git+https://github.com/DrMilgram/PT.git"
13 | },
14 | "keywords": [
15 | "ponytown",
16 | "game",
17 | "proxy",
18 | "fun",
19 | "bootsy",
20 | "niggest",
21 | "octavia",
22 | "catvideos",
23 | "pony",
24 | "mlp",
25 | "4chan"
26 | ],
27 | "author": "Bootsy",
28 | "license": "No license",
29 | "bugs": {
30 | "url": "https://github.com/DrMilgram/PT/issues"
31 | },
32 | "homepage": "https://github.com/DrMilgram/PT#readme",
33 | "dependencies": {
34 | "http-proxy": "^1.14.0",
35 | "jsdom": "^9.4.2"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/document.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | www.gayniggersmenage.net
29 |
30 |
31 |
32 |
33 |
34 |
35 | Loading...
36 |
37 |
75 |
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | Pony Town
29 |
30 |
31 |
32 |
33 |
34 |
35 | Loading...
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/proxytown.js:
--------------------------------------------------------------------------------
1 | //Shared with love by bootsy.
2 | var https = require('https'),
3 | http = require('http'),
4 | httpProxy = require('http-proxy'),
5 | fs = require('fs'),
6 | path = require('path'),
7 | jsdom = require('jsdom');
8 |
9 | var proxy = httpProxy.createProxyServer({
10 | target: 'https://pony.town',
11 | agent: https.globalAgent,
12 | headers: {
13 | host: 'pony.town'
14 | }
15 | });
16 |
17 | var server = http.createServer(function(req, res) {
18 | console.log("referer",req.headers.referer)
19 | //delete req.headers.referer;
20 | req.headers.referer="https://pony.town/"
21 | /*res.on2=res.on;
22 | res.on=function(){console.log("On!",arguments);
23 | //
24 | return res.on2.apply(this,arguments)}
25 | var res2=res
26 | res=Proxy.create({get:function(a,b){console.log("Get",b);return res2[b]},set:function(a,b,c){console.log("Set",b);res2[b]=c}},res2)
27 | */
28 | //console.log("hello",Object.keys(res))
29 | console.log(req.url)
30 | if (req.url === "/script.js") {
31 | fs.createReadStream(path.join(__dirname, 'script.js')).pipe(res)
32 | } else if (["/"].indexOf(req.url) > -1) {
33 | console.log("is this even executed")
34 | console.log(req.headers.cookie)
35 | console.log('hm')
36 | proxy.web(req, res);
37 | /* jsdom.env({
38 | url: "https://pony.town",
39 | cookie: req.headers.cookie,
40 | headers: {
41 | cookie: req.headers.cookie
42 | },
43 | done: function(err, window) {
44 | var document = window.document;
45 | var scripts="";
46 | Array.prototype.map.call(document.getElementsByTagName('script'), function(a) {
47 | return a
48 | }).forEach(function(a) {
49 | scripts+=a.outerHTML
50 | a.parentNode.removeChild(a)
51 | });
52 | document.body.innerHTML += " ";
53 | res.writeHead(200, {
54 | 'Content-Type': 'text/html'
55 | });
56 | res.write(jsdom.serializeDocument(document));
57 | res.end();
58 |
59 | }
60 | });*/
61 |
62 | } else if (["/js/libraries.js"].indexOf(req.url) > -1) {
63 | fs.createReadStream(path.join(__dirname, 'libraries.js')).pipe(res)
64 | }else if (/\/scripts\/bootstrap-[0-9]+.js/.test(req.url)) {//there was no other way
65 | console.log("bootstrap requested");
66 | res.writeHead(200, {
67 | 'Content-Type': 'text/javascript'
68 | });
69 | res.write("document.write(\"