Fix issue#1
This commit is contained in:
parent
8a6ef2d403
commit
426f7881e5
@ -191,6 +191,10 @@ function simpleHTTP (staticPath, req, res, dirContentFlag = false) {
|
||||
}
|
||||
|
||||
module.exports = class HTTPServer extends Component {
|
||||
static type () {
|
||||
return null;
|
||||
}
|
||||
|
||||
constructor (adr, syntaxTree) {
|
||||
super(adr, syntaxTree);
|
||||
this.routelist = [];
|
||||
|
@ -7,6 +7,10 @@ function logger (...p) {
|
||||
}
|
||||
|
||||
module.exports = class HTTPRedirector extends HTTPServer {
|
||||
static type () {
|
||||
return "redirect";
|
||||
}
|
||||
|
||||
constructor (adr, syntaxTree) {
|
||||
super(adr, syntaxTree);
|
||||
}
|
||||
@ -23,7 +27,7 @@ module.exports = class HTTPRedirector extends HTTPServer {
|
||||
if (!isNotDomained) {
|
||||
return this
|
||||
.callDomain(currentDomain, this.syntax.domains[currentDomain])
|
||||
.argv("redirect", req, res);
|
||||
.argv(this.syntax.domains[currentDomain].Type.type(), req, res);
|
||||
}
|
||||
return redirectPage(redirectTo, req, res);
|
||||
});
|
||||
|
@ -7,6 +7,10 @@ function logger (...p) {
|
||||
}
|
||||
|
||||
module.exports = class HTTPReverse extends HTTPServer {
|
||||
static type () {
|
||||
return "proxy";
|
||||
}
|
||||
|
||||
constructor (adr, syntaxTree) {
|
||||
super(adr, syntaxTree);
|
||||
}
|
||||
@ -24,7 +28,7 @@ module.exports = class HTTPReverse extends HTTPServer {
|
||||
if (!isNotDomained) {
|
||||
return this
|
||||
.callDomain(currentDomain, this.syntax.domains[currentDomain])
|
||||
.argv("proxy", req, res);
|
||||
.argv(this.syntax.domains[currentDomain].Type.type(), req, res);
|
||||
}
|
||||
return fetchProxy(req, res, reverseTo);
|
||||
});
|
||||
|
@ -8,6 +8,10 @@ function logger (...p) {
|
||||
}
|
||||
|
||||
module.exports = class HTTPRedirector extends HTTPServer {
|
||||
static type () {
|
||||
return "shttp";
|
||||
}
|
||||
|
||||
constructor (adr, syntaxTree) {
|
||||
super(adr, syntaxTree);
|
||||
}
|
||||
@ -24,7 +28,7 @@ module.exports = class HTTPRedirector extends HTTPServer {
|
||||
if (!isNotDomained) {
|
||||
return this
|
||||
.callDomain(currentDomain, this.syntax.domains[currentDomain])
|
||||
.argv("shttp", req, res);
|
||||
.argv(this.syntax.domains[currentDomain].Type.type(), req, res);
|
||||
}
|
||||
return simpleHTTP(redirectTo, req, res, !!this.syntax.showDir);
|
||||
});
|
||||
|
@ -126,7 +126,7 @@ function readInstructions (instructions, fullCode, forDomains=false) {
|
||||
}
|
||||
|
||||
function logger (...p) {
|
||||
return;
|
||||
//return;
|
||||
console.debug("[DEBUG.routemap]:", ...p);
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
type redirectHTTP;
|
||||
target https://duckduckgo.com;
|
||||
domain localhost {
|
||||
type redirectHTTP;
|
||||
type revHTTP;
|
||||
target https://google.com;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user