All Projects → MiguelCastillo → 3dub

MiguelCastillo / 3dub

Licence: MIT license
www dev server with livereload, file watching, http2, https, self signed cert generation

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to 3dub

Https Localhost
HTTPS server running on localhost
Stars: ✭ 122 (+335.71%)
Mutual labels:  certificate, https, http2
Certificaat
General-purpose ACME client
Stars: ✭ 88 (+214.29%)
Mutual labels:  certificate, https
Nico
A HTTP2 web server for reverse proxy and single page application, automatically apply for ssl certificate, Zero-Configuration.
Stars: ✭ 43 (+53.57%)
Mutual labels:  certificate, http2
Docker Nginx Gunicorn Flask Letsencrypt
Boilerplate code for setting up Nginx + Gunicorn + Flask + automated LetsEncrypt certificates (https) using docker-compose.
Stars: ✭ 117 (+317.86%)
Mutual labels:  certificate, https
Ansible Role Certbot
Ansible Role - Certbot (for Let's Encrypt)
Stars: ✭ 477 (+1603.57%)
Mutual labels:  certificate, https
Hiproxy
🛠 hiproxy is a lightweight proxy tool for Front-End developers based on Node.js that supports an NGINX-like configuration. 🔥
Stars: ✭ 629 (+2146.43%)
Mutual labels:  certificate, https
Acme client
Java ACME Client application
Stars: ✭ 77 (+175%)
Mutual labels:  certificate, https
tipi
Tipi - the All-in-one Web Server for Ruby Apps
Stars: ✭ 214 (+664.29%)
Mutual labels:  https, http2
esa-httpclient
An asynchronous event-driven HTTP client based on netty.
Stars: ✭ 82 (+192.86%)
Mutual labels:  https, http2
RB-libcURL
A Realbasic and Xojo binding to libcurl
Stars: ✭ 19 (-32.14%)
Mutual labels:  https, http2
Telegraph
Secure Web Server for iOS, tvOS and macOS
Stars: ✭ 474 (+1592.86%)
Mutual labels:  certificate, https
libmicrohttpd-http2
HTTP/2 support for libmicrohttpd
Stars: ✭ 21 (-25%)
Mutual labels:  https, http2
Acme Client Quick
get let's encrypt cert in five minutes
Stars: ✭ 295 (+953.57%)
Mutual labels:  certificate, https
Lettuceencrypt
Free, automatic HTTPS certificate generation for ASP.NET Core web apps
Stars: ✭ 939 (+3253.57%)
Mutual labels:  certificate, https
Crypt Le
Crypt::LE - Let's Encrypt / Buypass / ACME client and library in Perl for obtaining free SSL certificates (inc. generating RSA/ECC keys and CSRs). HTTP/DNS verification is supported out of the box, easily extended with plugins, easily dockerized.
Stars: ✭ 277 (+889.29%)
Mutual labels:  certificate, https
letsencrypt-www
Probably the easiest way to create | renew | deploy certificate
Stars: ✭ 27 (-3.57%)
Mutual labels:  certificate, https
concerto
A command line tool and a library to generate TLS certificates for development purposes.
Stars: ✭ 34 (+21.43%)
Mutual labels:  certificate, https
django-yadpt-starter
Yet Another Django Project Template skeleton for Django projects
Stars: ✭ 28 (+0%)
Mutual labels:  certificate, https
Mutual Tls Ssl
🔐 Tutorial of setting up Security for your API with one way authentication with TLS/SSL and mutual mutual authentication for a java based web server and a client with both Spring Boot. Different clients are provided such as Apache HttpClient, OkHttp, Spring RestTemplate, Spring WebFlux WebClient Jetty and Netty, the old and the new JDK HttpClient, the old and the new Jersey Client, Google HttpClient, Unirest, Retrofit, Feign, Methanol, vertx, Scala client Finagle, Featherbed, Dispatch Reboot, AsyncHttpClient, Sttp, Akka, Requests Scala, Http4s Blaze, Kotlin client Fuel, http4k, Kohttp and ktor. Also other server examples are available such as jersey with grizzly. Also gRPC examples are included
Stars: ✭ 163 (+482.14%)
Mutual labels:  certificate, https
cryptonice
CryptoNice is both a command line tool and library which provides the ability to scan and report on the configuration of SSL/TLS for your internet or internal facing web services. Built using the sslyze API and ssl, http-client and dns libraries, cryptonice collects data on a given domain and performs a series of tests to check TLS configuration…
Stars: ✭ 91 (+225%)
Mutual labels:  https, http2

3dub

Greenkeeper badge

www dev server with livereload and file watching for developing Single Page Applications.

Features

  1. Serve static files
  2. File watching of the static files
  3. Livereload when watched files change
    • Starts its own livereload server
    • Automatically inject livereload into your application
  4. Https and Http2 support
  5. Auto generation of self signed certs
  6. Proxy settings with socket support
  7. Built on top of battle tested tools such as Express, chokidar, tiny-lr, and more.

Examples

Hello world

This setup will quickly walk you through starting up a server with ZERO configuration (all default settings). Serve up static assets, monitor them and when they change, livereload will refresh the browser where you are viewing your application.

install 3dub globally

$ npm install 3dub -g

create public folder

By default, 3dub serves up static assets from a directory called public relative where 3dub starts from. So let's go ahead and create one if one does not already exist. All your code goes in there.

$ mkdir public

start 3dub

$ 3dub

view in the browser

$ open http://localhost:3000

Custom port via configuration file

Adding a configuration for 3dub is a way to customize default settings. Generally, you will create configuration files wherever you expect to start 3dub from.

configure 3dub

Create a file called .3dub.js and configure the server port.

module.exports = {
  "port": 4545
};

start 3dub

$ 3dub

CLI examples

All options available for 3dub are for both the CLI and configuration files. Configuration files just makes some situations easier to work with as in the case of defining complex option object when defining middlewares.

start 3dub with custom port

$ 3dub --port 4545

3dub with root directory

$ 3dub --root dest

3dub with http2 and custom port

$ 3dub --mode http2 --port 8443

Configuration

3dub allows you to define a configuration in your project's directory. You can also specify a default configuration file in your HOME directory. If you specify both, the your local project's definition will be mixed in with the settings defined in HOME.

The default name of your configuration is .3dub.json for JSON and .3dub.js for JavaScript. You can alternatively create a .3dub directory with an index.js that contains your settings.

Options (Configuration file and CLI)

CLI only supports subarg notation when working complex object.

  • config (string) Configuration file name to load. By default it will load .3dub.json and .3dub.js files or .3dub directory with an index.js file in it. CLI only

  • log (boolean) flag to disable logging of noisy messages. Defaults to true.

  • port (number) port to for the server to listen on for incoming requests. Defaults to 3000.

  • root (string) path to serve files from. Defaults to public.

  • history (string | object) to configure the history middleware for managing your SPA. For details on the settings, please see here. Defaults to index.html.

  • livereload (number | object | boolean) When false, livereload is disabled. When its a number, then livereload client and server use that as the port number. When it is an object, settings are those used by tiny-lr. If you want to specify different settings for the livereload client and livereload server, then you can define a server and a client object with the corresponding options. Default value is the port number 35729.

  • watch (string[] | object | boolean) When false, file watching is disabled. When string or array of strings, you sepcify the files and directories to be monitored for changes; globs are supported. If options is an object, then they are forwarded to chokidar. watch is only enabled when livereload is enabled. Defaults to the root directory.

  • proxies (array<{source, target}>) Array of objects with a source property for the local url path and a target to the remote url path we are mapping to.

  • middlewares (array<string | object | array> | object) Option to define middlewares to be loaded. You can specify an array of middleware module names, you can also specify an object whose keys are the names of middleware modules and the values are the corresponding options for them. You can also specify middlewares using subarg notation, which is an array where the first item is the middleware module name and the second item are the options for it; e.g. ["middleware-module", options].

  • spdy (object) configure the http2 handler. Please take a look at the spdy module for details on the valid options.

  • mode (string) configure what protocol to run. E.g. http, https, or http2. For https and http2 mode, you must provide the pair cert and key or pfx and passphrase. If you do not provide either, a self signed certificate will be automatically generated for you.

  • cert (string) When using https, the cert option is for specifying the file path to the certificate file to be used by the server.

  • key (string) When using https, the key option is for specifying the file path to the private key file to be used by the server.

  • pfx (string) When using https, the pfx option is for specifying the file path for the pfx file to be used by the server.

  • passphrase (string) When using https, the passphrase option is required for opening the pfx file that will be used by the server.

Self signed certificates

When running 3dub in https or http2 mode, you have the option to specify your own certificate. If one isn't provided, then 3dub will create its own self signed certificate and will log a warning. A self signed certificate is automatically created to make it really easy to get a dev server up and running. And... The self signed cerficate is not written to disk.

Installation

Install via npm as a dev dependency, and configure an npm script to start the server. This is my preferred approach as it allows you to define the version of 3dub on a per project basis and also removes the need to install 3dub globally.

$ npm install 3dub --save-dev

Install globally so that you can start 3dub from anywhere via CLI.

$ npm install 3dub -g

Requirements

For http2 to work as expected, nodejs 4.8.0 and above is required. This is because ALPN was added in that version of node which is required by browsers like Chrome to properly negotiate the protocol.

https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V4.md#2017-02-21-version-480-argon-lts-mylesborins

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].