'Webapp not running on localhost due to socket.io problems on raspberry-pi
I'm trying to run the L3MON project from github on a raspberry pi 4 with kali installed. I've installed L3MON according to the github https://github.com/D3VL/L3MON. All seems to be fine during install. But when I go to localhost:22533 the browser return "Unable to connect".
There were some issues with installing pm2 over npm (proxy issues) but I think I got those solved, I just noting this just in case it may still be related somehow. So the web-app isnt running. When I run pm2 show, it show the applet is constantly restarted, and does not run longer than a second:
pm2 show index Describing process with id 0 - name index
┌───────────────────┬──────────────────────────────────────────────────┐
│ status │ online │
│ name │ index │
│ namespace │ default │
│ version │ 1.0.0 │
│ restarts │ 117 │
│ uptime │ 1s │
│ script path │ /home/user/apps/L3MON/L3MON-v1.1.2/index.js │
│ script args │ N/A │
│ error log path │ /home/user/.pm2/logs/index-error.log │
│ out log path │ /home/user/.pm2/logs/index-out.log │
│ pid path │ /home/user/.pm2/pids/index-0.pid │
│ interpreter │ node │
│ interpreter args │ N/A │
│ script id │ 0 │
│ exec cwd │ /home/user/apps/L3MON/L3MON-v1.1.2 │
│ exec mode │ fork_mode │
│ node.js version │ 17.5.0 │
│ node env │ N/A │
│ watch & reload │ ✘ │
│ unstable restarts │ 0 │
│ created at │ 2022-02-21T17:45:48.170Z │
└───────────────────┴──────────────────────────────────────────────────┘
The logfile index-error.log reports a constant error with the following stack:
TypeError: IO.listen is not a function
at Object.<anonymous> (/home/tremonius/apps/L3MON/L3MON-v1.1.2/index.js:27:20)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Object.<anonymous> (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
In the code https://github.com/D3VL/L3MON/blob/master/server/index.js) this seems to hook into socket.io (ref line 11 and line 27).
const
express = require('express'),
app = express(),
IO = require('socket.io'),
geoip = require('geoip-lite'),
CONST = require('./includes/const'),
db = require('./includes/databaseGateway'),
logManager = require('./includes/logManager'),
clientManager = new (require('./includes/clientManager'))(db),
apkBuilder = require('./includes/apkBuilder');
global.CONST = CONST;
global.db = db;
global.logManager = logManager;
global.app = app;
global.clientManager = clientManager;
global.apkBuilder = apkBuilder;
// spin up socket server
let client_io = IO.listen(CONST.control_port);
I reinstalled socket.io using npm install socket.io, but the latest version was already installed.
I also have the L3MON project running on a VMware kali machine, and there all is fine, the web-app runs without issues and no errors in the logfile. Al installed version of java etc seem to be the same. Could it have something todo with ARM architecture of the Raspberry?
And thats where my I'm not getting any further so any help would be much appreciated!!!!
Version info:
└─$ uname -srm Linux 5.4.83-Re4son-v8l+ aarch64
└─$ lsb_release -a No LSB modules are available. Distributor ID: Kali Description: Kali GNU/Linux Rolling Release: 2022.1 Codename: kali-rolling
└─$ java -version Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true openjdk version "1.8.0_322" OpenJDK Runtime Environment (build 1.8.0_322-8u322-b06-1~deb9u1-b06) OpenJDK 64-Bit Server VM (build 25.322-b06, mixed mode)
└─$ node -v v17.5.0
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
