Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.git
node_modules
build
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
LOG_LEVEL=debug
DEBUG=localtunnel*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
build
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"dbaeumer.vscode-eslint"
],
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"eslint.useFlatConfig": true,
"eslint.workingDirectories": [
"src"
],
}
27 changes: 21 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
FROM node:10.1.0-alpine
FROM node:22 AS build

WORKDIR /app

COPY package.json /app/
COPY yarn.lock /app/
COPY package-lock.json /app/

RUN yarn install --production && yarn cache clean
RUN npm install

COPY . /app
COPY ./src /app/src
COPY ./bin /app/bin
COPY ./tsconfig.json /app

ENV NODE_ENV production
ENTRYPOINT ["node", "-r", "esm", "./bin/server"]
RUN npm run build

FROM node:22-alpine
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice


COPY --from=build /app/bin /app/bin
COPY --from=build /app/build /app/build
COPY --from=build /app/package.json /app/
COPY --from=build /app/package-lock.json /app/

WORKDIR /app

RUN npm install --production

ENV NODE_ENV=production
ENTRYPOINT ["node", "./bin/server.js"]
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ If your server is acting as a reverse proxy (i.e. nginx) and is able to listen o

Create a new tunnel. A LocalTunnel client posts to this enpoint to request a new tunnel with a specific name or a randomly assigned name.

### POST /api/tunnels/:id/kill

Disconnect a tunnel.

*Note* this endpoint is enabled only with `--secret` set.

### GET /api/status

General server information.
Expand Down
68 changes: 0 additions & 68 deletions bin/server

This file was deleted.

2 changes: 2 additions & 0 deletions bin/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env node
import "../build/src/bin/server.js"
21 changes: 21 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// @ts-check

import eslint from '@eslint/js';
import mochaPlugin from "eslint-plugin-mocha";
import tseslint from 'typescript-eslint';
import stylisticTs from '@stylistic/eslint-plugin-ts'

export default tseslint.config(
mochaPlugin.configs.flat.recommended,
eslint.configs.recommended,
tseslint.configs.recommended,
{
plugins: {
'@stylistic/ts': stylisticTs
},
rules: {
"@typescript-eslint/no-unused-vars": "warn",
'@stylistic/ts/indent': ['error', 2],
},
},
);
132 changes: 0 additions & 132 deletions lib/Client.js

This file was deleted.

Loading