From d320da8ffc7db6d551ad2069386012e967969558 Mon Sep 17 00:00:00 2001 From: Luna Date: Wed, 19 Oct 2022 20:50:38 +0200 Subject: [PATCH] Update README.md --- README.md | 54 ++++-------------------------------------------------- 1 file changed, 4 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 19db250..21454ba 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ ![](https://img.shields.io/github/downloads/Luna-devv/proxy/total) Basic proxy script written in [node.js](https://nodejs.org) using [node:http](https://nodejs.org/api/http.html) and [node-http-proxy](https://github.com/http-party/node-http-proxy).
-This script was originally written from [@flamexdev](https://github.com/flamexdev/proxy) and was improved and re-written into [TypeScript](https://www.typescriptlang.org/) by me. +This script was originally written from [@flamexdev](https://github.com/flamexdev/proxy) and was improved and re-written into [TypeScript](https://www.typescriptlang.org/) by me.
+A full walk trough can be found on [this GitHub's Wiki](https://github.com/Luna-devv/proxy/wiki). ## Setup 1. Clone this repository using `git clone https://github.com/Luna-devv/proxy` @@ -39,55 +40,8 @@ There are 3 essential types: - `"WS"`: You will use this if you have a (server) websocket and you want i.e. to forward it from `123.456.789:4000` to `api.waya.one`. - `"REDIRECT"`: YOu will use this if you want to redirect the user to another page, this requires setting `target` to a string. -## Additional entries -If you want to do more complex stuff with the proxy, you can do that too.
-Here is an example object with *all* possible configurations: -```ts -"proxy.local": { - target: 3000, - type: "WEB", - arc: true, - ip: '127.0.9.1', - overwrites: [ - { - path: ['/sex', '/sex2'], - target: 'https://google.com', - type: "REDIRECT" - } - ] -} -``` - -### arc -This value can only be `true` or `false`, this key is optional.
-If your site is using [arc.io](https://arc.io/) you can just set this value to `true` to enable support for it.
-Note: All requests to `/arc-sw.js` will be catched by the proxy and will **NOT** reach your webserver. - -### ip -This value can only be a [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), this key is optional.
-By default, this script will proxy using the local [`127.0.0.1`](https://www.google.co.jp/search?q=127.0.0.1) IP. If you use docker or generally want to proxy domains for different servers, you can simply change this value to any other IP address. - -### overwrites -This value can only be a [Overwrites Array](#overwrites.path), this key is optional.
-Overwrites are made to redirect or proxy only specific parts (routes) of the domain and not the whole domain at once. - -### overwrites.path -This value can only be a [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) or a [String Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#create_an_array), this key is required inside of [`overwrites`](#overwrites).
-This will represent the path(s) that will be overwritten. It can be either one (a String) or multiple (an Array) like in the example object above.
-Note: All requests to this/these path(s) will be catched by the proxy and will **NOT** reach your webserver. - -### overwrites.target -This value can only be a [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), this key is required inside of [`overwrites`](#overwrites).
-For more reference please go to [#target](#target). - -### overwrites.type -This value can only be `WEB` or `REDIRECT`, this key is required inside of [`overwrites`](#overwrites).
-For more reference please go to [#type](#type).
-Note: `WS` (websockets) aren't supported as overwrite. - -## Modify error pages -If you want to to change the error pages for either a missing record ([`404.html`](https://github.com/Luna-devv/proxy/blob/main/html/404.html)) or the page for a not responding webserver ([`500.html`](https://github.com/Luna-devv/proxy/blob/main/html/500.html)), go to the [`/html/`](https://github.com/Luna-devv/proxy/tree/main/html) file tree and start editing your plain HTML pages there.
-Note: There is a `{hosts}` placeholder that will be replaced with the requested domain (i.e.: `proxy.local`) +## Anything else +**Please read the wiki at https://github.com/Luna-devv/proxy/wiki** ## Any questions left? Feel free to open a issue, send me an [E-Mail](mailto:luna@waya.one) or [join](https://lunish.nl/support) my Discord server.