License: MIT
diff --git a/serverSideScript.js b/serverSideScript.js
index 99b7b6d..255ae32 100644
--- a/serverSideScript.js
+++ b/serverSideScript.js
@@ -67,6 +67,7 @@ if(href == "/hello.svr") {
//Prevent open proxy
callServerError(403,"SVR.JS-exampleproxy"); //Server error
serverconsole.errmessage("Client fails to recieve content."); //Log into SVR.JS
+ return;
}
var hdrs = req.headers;
hdrs["Host"] = (hn == "this" ? req.headers.host : hn);
diff --git a/svr.js b/svr.js
index 3dd2cae..01b8932 100644
--- a/svr.js
+++ b/svr.js
@@ -71,7 +71,7 @@ function deleteFolderRecursive(path) {
}
var os = require("os");
-var version = "3.4.22";
+var version = "3.4.23";
var singlethreaded = false;
if (process.versions) process.versions.svrjs = version; //Inject SVR.JS into process.versions
@@ -4349,11 +4349,17 @@ function start(init) {
if (!cluster.isPrimary) {
- if (secure) {
- server.listen(sport);
- if (!disableNonEncryptedServer) server2.listen(port);
- } else {
- server.listen(port);
+ try {
+ server.listen(secure ? sport : port);
+ } catch(err) {
+ if(err.code != "ERR_SERVER_ALREADY_LISTEN") throw err;
+ }
+ if (secure && !disableNonEncryptedServer) {
+ try {
+ server2.listen(port);
+ } catch(err) {
+ if(err.code != "ERR_SERVER_ALREADY_LISTEN") throw err;
+ }
}
}
diff --git a/tests.html b/tests.html
index e0d72ac..311ab14 100644
--- a/tests.html
+++ b/tests.html
@@ -1,7 +1,7 @@
-
SVR.JS 3.4.22 Tests
+ SVR.JS 3.4.23 Tests
- SVR.JS 3.4.22 Tests
+ SVR.JS 3.4.23 Tests
Directory
Directory (with query)