mirror of
https://github.com/bitinflow/server.git
synced 2026-03-13 13:35:53 +00:00
remove engine.io
No need for homepage to show this stuff for now. Just more things that can crash the tunnel server!
This commit is contained in:
@@ -14,9 +14,6 @@
|
|||||||
"bookrc": "0.0.1",
|
"bookrc": "0.0.1",
|
||||||
"book-git": "0.0.2",
|
"book-git": "0.0.2",
|
||||||
"book-raven": "1.0.1",
|
"book-raven": "1.0.1",
|
||||||
"engine.io": "0.7.12",
|
|
||||||
"engine.io-client": "0.7.12",
|
|
||||||
"flip-counter": "0.5.3",
|
|
||||||
"browserkthx": "0.0.2",
|
"browserkthx": "0.0.2",
|
||||||
"hbs": "2.4.0",
|
"hbs": "2.4.0",
|
||||||
"taters": "0.1.0",
|
"taters": "0.1.0",
|
||||||
|
|||||||
31
server.js
31
server.js
@@ -6,7 +6,6 @@ var enchilada = require('enchilada');
|
|||||||
var stylish = require('stylish');
|
var stylish = require('stylish');
|
||||||
var makeover = require('makeover');
|
var makeover = require('makeover');
|
||||||
var makeup = require('makeup');
|
var makeup = require('makeup');
|
||||||
var engine = require('engine.io');
|
|
||||||
var browserkthx = require('browserkthx');
|
var browserkthx = require('browserkthx');
|
||||||
var tldjs = require('tldjs');
|
var tldjs = require('tldjs');
|
||||||
var on_finished = require('finished');
|
var on_finished = require('finished');
|
||||||
@@ -229,36 +228,6 @@ module.exports = function(opt) {
|
|||||||
app_port = app_server.address().port;
|
app_port = app_server.address().port;
|
||||||
});
|
});
|
||||||
|
|
||||||
// connected engine.io sockets for stats updates
|
|
||||||
var eio_sockets = [];
|
|
||||||
|
|
||||||
setInterval(function() {
|
|
||||||
eio_sockets.forEach(function(socket) {
|
|
||||||
socket.send(JSON.stringify(stats));
|
|
||||||
});
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
var eio_server = engine.attach(app_server);
|
|
||||||
eio_server.on('connection', function (socket) {
|
|
||||||
|
|
||||||
eio_sockets.push(socket);
|
|
||||||
socket.send(JSON.stringify(stats));
|
|
||||||
|
|
||||||
socket.on('error', function(err) {
|
|
||||||
log.error(err);
|
|
||||||
socket.close();
|
|
||||||
});
|
|
||||||
|
|
||||||
socket.on('close', function() {
|
|
||||||
|
|
||||||
// remove from socket pool so no more updates are sent
|
|
||||||
var idx = eio_sockets.indexOf(socket);
|
|
||||||
if (idx >= 0) {
|
|
||||||
eio_sockets.splice(idx, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
var server = bouncy(function(req, res, bounce) {
|
var server = bouncy(function(req, res, bounce) {
|
||||||
debug('request %s', req.url);
|
debug('request %s', req.url);
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +1 @@
|
|||||||
var eio = require('engine.io-client');
|
|
||||||
var flipCounter = require('flip-counter');
|
|
||||||
|
|
||||||
var user_counter = new flipCounter('user-count', {
|
|
||||||
value: 0,
|
|
||||||
pace: 10,
|
|
||||||
fW: 30,
|
|
||||||
tFH: 20,
|
|
||||||
bFH: 40,
|
|
||||||
bOffset: 200,
|
|
||||||
auto: false
|
|
||||||
});
|
|
||||||
|
|
||||||
var socket = eio();
|
|
||||||
socket.on('open', function () {});
|
|
||||||
|
|
||||||
socket.on('message', function (data) {
|
|
||||||
var msg = JSON.parse(data);
|
|
||||||
user_counter.incrementTo(msg.tunnels);
|
|
||||||
});
|
|
||||||
|
|
||||||
socket.on('close', function () {
|
|
||||||
user_counter.incrementTo(0);
|
|
||||||
});
|
|
||||||
|
|
||||||
// load google analytics after above starts
|
|
||||||
require('./ga');
|
require('./ga');
|
||||||
|
|||||||
@@ -65,15 +65,6 @@ your url is: https://gqgh.localtunnel.me</pre></div>
|
|||||||
|
|
||||||
<p>You can now share <em>https://gqgh.localtunnel.me</em> with anyone. As long as your local instance of <strong>lt</strong> is running, this url will remain active. Any requests to that url will be routed to your service on port 8000.</p>
|
<p>You can now share <em>https://gqgh.localtunnel.me</em> with anyone. As long as your local instance of <strong>lt</strong> is running, this url will remain active. Any requests to that url will be routed to your service on port 8000.</p>
|
||||||
|
|
||||||
<p>When you start and stop your tunnel, you will see it reflected in the active tunnel count below.</p>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="half">
|
|
||||||
<h3>Tunnels</h3>
|
|
||||||
<div id="user-count" class="flip-counter"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h2>other cool stuff</h2>
|
<h2>other cool stuff</h2>
|
||||||
<h3><i class="fa fa-lock"></i> Secure https for all tunnels</h3>
|
<h3><i class="fa fa-lock"></i> Secure https for all tunnels</h3>
|
||||||
<h3><i class="fa fa-desktop"></i> Show your work to anyone</h3>
|
<h3><i class="fa fa-desktop"></i> Show your work to anyone</h3>
|
||||||
|
|||||||
Reference in New Issue
Block a user