tlsd
v2.18.1
Published
A server for web app prototyping with HTTPS and Websockets
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 tlsdThe tlsd module should now be added to your local package.json file and you can run it this way:
npx tlsdThis 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_projectThis can then be tested by starting the server:
tlsd run dev my_project 12345 3And 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 verbosityAll 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_roottlsd 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 [email protected] VERBOSITY=4 node tlsd.jsAll 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_rootor use Greenlock directly:
npx greenlock add --subject example.com --altnames example.com,www.example.comTLS mode serves files with Letsencrypt SSL certs magically.
