Skip to content

Commit

Permalink
fix(#2): localtunnel tolerates short names
Browse files Browse the repository at this point in the history
  • Loading branch information
talss89 committed Sep 21, 2023
1 parent 998d758 commit a5c26c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let BudLocaltunnel = class BudLocaltunnel extends Extension {
#devTunnel;
async configAfter(bud) {
if (bud.isDevelopment) {
this.#devTunnel = await localtunnel({ subdomain: bud.context.label, local_host: bud.server?.url.hostname, port: bud.server?.url.port });
this.#devTunnel = await localtunnel({ subdomain: bud.context.label.length > 3 ? bud.context.label : undefined, local_host: bud.server?.url.hostname, port: bud.server?.url.port });
const tunnelUrl = new URL(this.#devTunnel.url);
bud.setPublicUrl(tunnelUrl);
this.#devTunnel.on('close', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class BudLocaltunnel extends Extension<
@bind
public override async configAfter(bud: Bud) {
if(bud.isDevelopment) {
this.#devTunnel = await localtunnel({ subdomain: bud.context.label, local_host: bud.server?.url.hostname, port: bud.server?.url.port })
this.#devTunnel = await localtunnel({ subdomain: bud.context.label.length > 3 ? bud.context.label : undefined, local_host: bud.server?.url.hostname, port: bud.server?.url.port })

const tunnelUrl = new URL(this.#devTunnel.url);

Expand Down

0 comments on commit a5c26c6

Please sign in to comment.