mirror of
https://github.com/bitinflow/localtunnel.git
synced 2026-03-13 13:35:54 +00:00
refactor server tcp handling
- limit on number of tcp connections - preliminary support for websockets
This commit is contained in:
12
lib/rand_id.js
Normal file
12
lib/rand_id.js
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
var chars = 'abcdefghiklmnopqrstuvwxyz';
|
||||
module.exports = function rand_id() {
|
||||
var randomstring = '';
|
||||
for (var i=0; i<4; ++i) {
|
||||
var rnum = Math.floor(Math.random() * chars.length);
|
||||
randomstring += chars[rnum];
|
||||
}
|
||||
|
||||
return randomstring;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user