Proxy
My proxymanager for my server
Install / Use
/learn @shi-gg/ProxyREADME
Basic proxy script written in node.js using node:http and node-http-proxy. <br /> This script was originally written from @flamexdev and was improved and re-written into TypeScript by me. <br> A full walk trough can be found on this GitHub's Wiki.
Setup
- Clone this repository using
git clone https://github.com/Luna-devv/proxy - Adapt the
src/hosts.tsto your needs and webservers - Install all external dependencies using
npm installoryarn install - Compile the code using
npx tsc - Run the script with PM2
pm2 start dist/app.js --name proxy
Modify records
Example object for proxing a webserver:
{
"proxy.local": {
target: 3000,
type: "WEB"
}
}
key ("proxy.local")
This value can only be a String, this key is required. <br />
This will be the subdomain (subdomain.proxy.local) or the domain (proxy.local) that will be managed.
target
This value can only be a String, this key is required. <br />
- (using
"WEB"or"WS"): This is the port on which your webserver runs. Please note that this musst run on the same server as this proxy script. - (using
"REDIRECT"): This is the domain/IP the proxy script will redirect to. Note that this can be any domain, it must include the protocal (i.e."https://lunish.nl/luna")
type
This value can only be WEB, WS or REDIRECT, this key is required. <br />
There are 3 essential types:
"WEB": You will use this if you want that for example the content of the page123.456.789:4000should be displayed onapi.waya.one."WS": You will use this if you have a (server) websocket and you want i.e. to forward it from123.456.789:4000toapi.waya.one."REDIRECT": YOu will use this if you want to redirect the user to another page, this requires settingtargetto a string.
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 or join my Discord server.
