mirror of
https://github.com/bitinflow/server.git
synced 2026-03-13 13:35:53 +00:00
Generate human readable IDs for client URLs (#77)
Based on @FranzSkuffka's suggested enhancement in PR 207 on localtunnel/localtunnel (https://github.com/localtunnel/localtunnel/pull/207), this PR uses the "human-readable-ids" package to generate IDs of the form "adjective-noun-number". These IDs are easier to remember and arguably more useful in testing since they can be retyped without copying and pasting. Some sample IDs generated by this package are: * heavy-puma-90 * grump-walrus-64 * purple-starfish-58 * nasty-seahorse-9
This commit is contained in:
committed by
Roman Shtylman
parent
d7852a3dd1
commit
b1c296a409
@@ -4,9 +4,9 @@ import tldjs from 'tldjs';
|
||||
import Debug from 'debug';
|
||||
import http from 'http';
|
||||
import Promise from 'bluebird';
|
||||
import { hri } from 'human-readable-ids';
|
||||
|
||||
import ClientManager from './lib/ClientManager';
|
||||
import rand_id from './lib/rand_id';
|
||||
|
||||
const debug = Debug('localtunnel:server');
|
||||
|
||||
@@ -51,7 +51,7 @@ module.exports = function(opt) {
|
||||
|
||||
const isNewClientRequest = ctx.query['new'] !== undefined;
|
||||
if (isNewClientRequest) {
|
||||
const req_id = rand_id();
|
||||
const req_id = hri.random();
|
||||
debug('making new client with id %s', req_id);
|
||||
const info = await manager.newClient(req_id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user