School project for M122
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Roxy 3863bc39c2 fixing gay shitz 10 months ago
README.md yea i wish to die 10 months ago
config.json yea i wish to die 10 months ago
installer.sh fixing gay shitz 10 months ago
proxy.rb yea i wish to die 10 months ago

README.md

ruby-rewrite-proxy

This project sets up a simple HTTP proxy using Ruby and Nginx. It's designed to forward requests to a specified host, with the option to replace certain strings in the response.

IT IS IN NO WAY FINISHED OR IN A STABLE STATE DO NOT FOLLOW THIS GUIDE, IT SERVERS AS A GUIDELINE ON HOW THE INSTALLATION AND FUNCTION SHOULD BE AND NOT YET AS A GUIDE

Installation

To install the necessary dependencies and set up the proxy, run the following command:

sudo bash installer.sh

Please dont forget to copy the installer from /root/ruby-proxy to your home directory and to change its owner recursively

This will:

Install Ruby and the 'webrick' gem.
Install Nginx and enable it to start on boot.
Create a directory in the current user's home directory called 'ruby-proxy'.
Clone this repository into the 'ruby-proxy' directory.
Prompt you to enter values for 'server_name' and 'proxy_set_header'.
Create an Nginx configuration file using the provided template and your input.
Enable the new Nginx site.
Reload Nginx to apply the changes.

After running the script, don't forget to adjust config.yml to your likings.

Configuration

The proxy.rb script reads its configuration from config.yml. This file specifies the host to proxy requests to, the port to listen on, and a set of string replacements to apply to the response.

Logging

The proxy.rb script logs its output to ruby-proxy.log in the same directory.

Usage

To start the proxy, run the following command:

ruby proxy.rb

This will start the proxy, listening on the port specified in config.yml.