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 CHANGED
@@ -33,7 +33,7 @@ class Lproxy {
33
33
  let o = Object.assign({
34
34
  target: url,
35
35
  ws: true,
36
- changeOrigin: true,
36
+ // changeOrigin: true,
37
37
  // localAddress: '0.0.0.0',
38
38
  }, options)
39
39
  console.log("proxy object", o)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "2.15.82",
3
+ "version": "2.15.84",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
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
- const primary_port = 80
2047
- const secondary_port = 42000
2048
- const running1 = await Util.port_running("localhost", primary_port)
2049
- const running2 = await Util.port_running("127.0.0.1", primary_port)
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
- this.port = secondary_port
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