# tlsd

> A server for web app prototyping with HTTPS and Websockets

Latest version **2.21.0** (published 2026-09-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install tlsd
pnpm add tlsd
yarn add tlsd
bun add tlsd
```

Provides the command `tlsd`.

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 2.21.0 |
| Published | 2026-09-04 |
| First published | 2021-12-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 468.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Joe Hitchens |
| Maintainers | sleeplessinc |

## Links

- npm: https://www.npmjs.com/package/tlsd
- npm.io page: https://npm.io/package/tlsd

## Dependencies (11)

- [g](https://npm.io/package/g.md) ^2.0.1
- [cors](https://npm.io/package/cors.md) ^2.8.5
- [sass](https://npm.io/package/sass.md) ^1.69.5
- [allcore](https://npm.io/package/allcore.md) ^1.0.1
- [connect](https://npm.io/package/connect.md) ^3.7.0
- [sleepless](https://npm.io/package/sleepless.md) ^5.13.0
- [websocket](https://npm.io/package/websocket.md) ^1.0.34
- [body-parser](https://npm.io/package/body-parser.md) ^1.20.2
- [compression](https://npm.io/package/compression.md) ^1.7.4
- [serve-static](https://npm.io/package/serve-static.md) ^1.15.0
- [greenlock-express](https://npm.io/package/greenlock-express.md) ^4.0.3

## Recent versions

- 2.21.0 (latest) — 2026-09-04
- 2.20.2 — 2026-04-03
- 2.20.1 — 2026-03-18
- 2.20.0 — 2026-03-17
- 2.19.0 — 2026-02-22
- 2.18.1 — 2026-01-11
- 2.18.0 — 2026-01-09
- 2.16.3 — 2025-11-13
- 2.16.1 — 2025-10-17
- 2.15.3 — 2025-08-15
- 2.15.0 — 2025-07-24
- 2.12.2 — 2025-01-26
- 2.12.1 — 2025-01-26
- 2.12.0 — 2025-01-26
- 2.11.2 — 2024-05-06
- … 28 more at https://npm.io/package/tlsd/versions

## README

# tlsd

This is a node.js based webserver.
It is designed for development work on prototype web applications.
It is *not* designed for production websites.

## Features

	- SSL/TLS via Greenlock
	- Websockets built in
    - Standardised Websockets/RPC protocol for front/back end communications
	- Utility command 'tlsd'


## Installing


Install tlsd into your project:

	npm install tlsd

The tlsd module should now be added to your local package.json file and you can
run it this way:

	npx tlsd

This way you can just use it to serve your local project in dev or TLS mode.


## tlsd init

Creates empty scaffolding files for a project:

    mkdir my_project
	tlsd init my_project

This can then be tested by starting the server:

	tlsd run dev my_project 12345 3

And then browsing to "http://localhost:12345".
You should see the pages being delivered and a websocket connection being established.


## tlsd run dev

In dev mode, tlsd runs a plain HTTP server without TLS/SSL security.
This is for local (your computer) development:

    tlsd run dev root_dir port verbosity

All arguments are required.


## tlsd domain

Adds a domain to Greenlock and links the site's root so it can be served with HTTPS:

	tlsd domain example.com /absolute/path/to/site_root


## tlsd version

Displays the current version of tlsd


### TLS Mode

In HTTPS mode, you must specify the dir containing links/dirs for domains to serve
it will run on HTTP on 80 (redirecting to 443), HTTPS on 443, and magically
generate certs and serve secure sites like nodes:

    DOMAINS_ROOT=./my_domains MAINTAINER_EMAIL=foo@bar.com VERBOSITY=4  node tlsd.js

All env vars are required.

You must also register your domain before running in TLS mode, otherwise it won't be recognized. Either run:

	tlsd domain example.com /absolute/path/to/site_root

or use Greenlock directly:

	npx greenlock add --subject example.com --altnames example.com,www.example.com

TLS mode serves files with Letsencrypt SSL certs magically.

---
_Source: https://npm.io/package/tlsd · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
