Nosy Pinocchio Manners

    0.3.2 • Public • Published

    npm License

    Loopback domain and SSL certificates:

    https://<any subdomain> → https://localhost/

    Any subdomain of points to localhost!

    Exception:, which points to a page where you can download the certificates.

    Why ?

    At Pryv we often have to locally develop web applications that intensively use AJAX REST requests.

    Browsers enforce the same-origin policy mechanism that restricts the loading of resources from another origin. This can be allowed by sending correct Cross-Origin Resource Sharing (CORS) headers.

    But making requests to HTTPS APIs from HTTP sites on localhost would not be possible without changing security options on your browser, which is why we refurbished a domain and its SSL certificates as a full loopback domain, to let anyone benefit from a signed certificate on localhost.

    Update: where are the certificates?

    From v0.2 onwards, certificates are not bundled with the npm package, but downloaded and updated from at installation and runtime, or manually with

    Note: If the certificates are outdated and loaded synchronously with require('').httpsOptions() (see usage below), they will be updated and the service stopped, so it can be rebooted manually.



    npm install

    Command line

    (Don't forget to prefix commands with npx if not installed globally.)

    Start a webserver serving the contents of a directory on<port>/: <path> [<port>]

    Start a proxy on<port>/: <target host>[:<target port>] [<port>]

    Manually update the certificates:

    Certificate files

    You can also directly use the certificates files on

    • The certificate
    • The private key
    • Certificate of the authority
    • Bundle of key + CA
    • pack.json: All the above in a JSON file

    From a node app

    Pure Node.js

    const https = require('https');
    const options = require('').httpsOptions();
    https.createServer(options, (req, res) => {
      res.end('hello world\n');

    Or (check and update before):

    const https = require('https');
    const httpsOptionsAsync = require('').httpsOptionsAsync;
    httpsOptionsAsync(function (err, httpsOptions) {
      https.createServer(httpsOptions, (req, res) => {
        res.end('hello world\n');


    const https = require('https');
    const httpsOptionsAsync = require('').httpsOptionsAsync;
    const express = require('express');
    const app = express();
    // ...your code...
    httpsOptionsAsync(function (err, httpsOptions) {
      https.createServer(httpsOptions, app).listen(8443);


    Enable local HTTPS for development:

    const recLaOptions = require('').httpsOptions();
    recLaOptions.https = true; = '';
    module.exports = {
      // ...your options...
      devServer: recLaOptions

    Now vue-cli-service serve will be served on


    npm run start starts the webserver (see CLI command above)

    npm run proxy starts the proxy (see CLI command above)

    npm run lint lints the code with Semi-Standard.

    Pull requests are welcome.




    npm i

    DownloadsWeekly Downloads






    Unpacked Size

    14.1 kB

    Total Files


    Last publish


    • perki
    • sgoumaz