pinokiod 2.15.82 → 2.15.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/kernel/lproxy.js +1 -1
- package/package.json +1 -1
- package/server/index.js +17 -11
package/kernel/lproxy.js
CHANGED
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -2043,18 +2043,24 @@ class Server {
|
|
|
2043
2043
|
if (options && options.port) {
|
|
2044
2044
|
this.port = options.port
|
|
2045
2045
|
} else {
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
const running = running1 || running2
|
|
2051
|
-
const available = !running
|
|
2052
|
-
//const available = await portfinder.isAvailablePromise({ host: "0.0.0.0", port: primary_port })
|
|
2053
|
-
console.log("check available", { primary_port, available })
|
|
2054
|
-
if (available) {
|
|
2055
|
-
this.port = primary_port
|
|
2046
|
+
let platform = os.platform()
|
|
2047
|
+
if (platform === 'linux') {
|
|
2048
|
+
// on linux you are not allowed to listen on ports below 1024
|
|
2049
|
+
this.port = 42000
|
|
2056
2050
|
} else {
|
|
2057
|
-
|
|
2051
|
+
const primary_port = 80
|
|
2052
|
+
const secondary_port = 42000
|
|
2053
|
+
const running1 = await Util.port_running("localhost", primary_port)
|
|
2054
|
+
const running2 = await Util.port_running("127.0.0.1", primary_port)
|
|
2055
|
+
const running = running1 || running2
|
|
2056
|
+
const available = !running
|
|
2057
|
+
//const available = await portfinder.isAvailablePromise({ host: "0.0.0.0", port: primary_port })
|
|
2058
|
+
console.log("check available", { primary_port, available })
|
|
2059
|
+
if (available) {
|
|
2060
|
+
this.port = primary_port
|
|
2061
|
+
} else {
|
|
2062
|
+
this.port = secondary_port
|
|
2063
|
+
}
|
|
2058
2064
|
}
|
|
2059
2065
|
}
|
|
2060
2066
|
|