commit 5835becb626f8ccbf431b11d36959702d05ae588 Author: Roxy Date: Thu May 25 11:02:05 2023 +0200 commit warcrimes diff --git a/README.md b/README.md new file mode 100644 index 0000000..cbd3624 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# e621 Full Proxy + +## What the fuck is this ? +Basically a script that was made by Yessiest that I've adapted to be a full proxy for e621 so you can access it at school so you can stay alive while being there 3====D diff --git a/furry-sex.rb b/furry-sex.rb new file mode 100755 index 0000000..1372ee0 --- /dev/null +++ b/furry-sex.rb @@ -0,0 +1,38 @@ +#!/usr/bin/env ruby + +require "webrick" +require "net/http" +require "uri" + +$replacements = { + "e621.net" => "e621.fuwwy.ch", # Replace this with your domain/subdomain obviously + ">e621<" => ">e621.fuwwy.ch<", # This basically just changes the title shown on the main page + "https:" => "http:" # only needed if your nginx backend doesnt have ssl yet +} + +class MyProxy < WEBrick::HTTPServlet::AbstractServlet + HOST = "e621.net" # set host to proxy duh + + def do_GET(request, response) + uri = request.unparsed_uri + + http = Net::HTTP.new(HOST, 443) + http.use_ssl = true + + resp = http.request(Net::HTTP::Get.new(uri, {"User-Agent" => "amongus happy meal guys this is crazy i ordered an amogus happy meal at 3am hugy wugy came and sucked my dick this is so scary"})) + # please change this user agent to something unique otherwise e621 will block your request and you might get IP banned + body = resp.body + + response.content_type = resp["content-type"] + $replacements.each { |k,v| + body = body.gsub(k,v) + } + response.body = body + end +end + +server = WEBrick::HTTPServer.new(:Port => ENV["PORT"] || 8000) # define port on which the proxy runs ... so this would be localhost:8000 +server.mount "/", MyProxy + +trap("INT"){ server.shutdown } +server.start diff --git a/nginx-config.conf b/nginx-config.conf new file mode 100644 index 0000000..80581d0 --- /dev/null +++ b/nginx-config.conf @@ -0,0 +1,61 @@ +resolver 8.8.8.8; +#set dns resolver + +server { + listen 80; + server_name e621.fuwwy.ch; #change this to your server name + + location / { + proxy_pass https://e621.net:443; + proxy_set_header Host e621.net; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_ssl_server_name on; #i dont know why this is needed + proxy_ssl_verify off; #but it wont work without it + sub_filter 'e621.net' 'e621.fuwwy.ch'; #simple rewriter that usually works but not for e6 + sub_filter_once off; + sub_filter_types *; + } + + location /favicon.ico { + return 204; + access_log off; + log_not_found off; + } + + location /robots.txt { + return 200 "User-agent: *\nDisallow: /"; + access_log off; + log_not_found off; + } +} + +server { + listen 80; + server_name static1.e621.fuwwy.ch; #same here + + location / { + proxy_pass https://static1.e621.net:443; + proxy_set_header Host static1.e621.net; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_ssl_server_name on; + proxy_ssl_verify off; + sub_filter 'e621.net' 'e621.fuwwy.ch'; + sub_filter_once off; + sub_filter_types *; + } + + location /favicon.ico { + return 204; + access_log off; + log_not_found off; + } + + location /robots.txt { + return 200 "User-agent: *\nDisallow: /"; + access_log off; + log_not_found off; + } +} +