-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
26 lines (24 loc) · 689 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!DOCTYPE html>
<html>
<head>
<script>
var gui = require('nw.gui');
var document = document;
var portfinder = require('portfinder');
var app = require('./index.js');
app.pid = process.pid;
app.argv = gui.App.argv.slice(0);
var max = 65535;
var min = 49152;
portfinder.basePort = (Math.floor(Math.random() * (max - min + 1)) + min);
portfinder.getPort(function (err, port) {
var port = port;
app.port = port;
app.use(require('./aria2'), { location: 'aria2c' });
app.use(require('./server'), { port: port });
app.init(function (){ document.title = process.title; });
document.location = 'http://localhost:'+port;
});
</script>
</head>
</html>