{"_id":"easy-https","_rev":"260662","name":"easy-https","description":"Zero config, one step local https server with custom local domain.","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"pie6k","email":"adam@pietrasiak.com"}],"time":{"modified":"2024-06-16T01:09:31.000Z","created":"2020-10-10T12:21:02.798Z","1.0.1":"2020-10-10T12:44:19.872Z","1.0.0":"2020-10-10T12:21:02.798Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/pie6k/easy-https.git"},"versions":{"1.0.1":{"name":"easy-https","description":"Zero config, one step local https server with custom local domain.","keywords":["https","nodejs","mkcert","server","localhost"],"version":"1.0.1","scripts":{"test":"ts-node test/index.ts","build":"rimraf dist && tsc"},"main":"./dist/index.js","homepage":"https://github.com/pie6k/easy-https/","repository":{"type":"git","url":"git+https://github.com/pie6k/easy-https.git"},"devDependencies":{"@types/node":"^14.11.8","@types/open":"^6.2.1","hostile":"^1.3.2","https-localhost":"^4.6.2","open":"^7.3.0","temp-dir":"^2.0.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"dependencies":{"rimraf":"^3.0.2"},"gitHead":"a1161af9749643742f12c2931680c02d23ac0b53","bugs":{"url":"https://github.com/pie6k/easy-https/issues"},"_id":"easy-https@1.0.1","_nodeVersion":"12.17.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-EPFMWVTYKhXKfz8ocs/r+eLMdmMdR+QljXNOsW3juxM/phMeMqsNCoUmPCCSzogDbw2vmtyYRR6xVb5TNncy5Q==","shasum":"ef80b4b0b1833df445e6c4ce0b063667873d6715","tarball":"http://registry-npm.ywwl.com/easy-https/download/easy-https-1.0.1.tgz","fileCount":10,"unpackedSize":22831,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgaykCRA9TVsSAnZWagAAr/QP/34zbeR0vi1Ac2Udlumq\nKe8XG8RcIZobMxFUbRSrmiqdWMvf5GZZpgeRH+C2AbC4ru2npLT2APRMD/zQ\nJIR+E+yBeGKMQ6fSFrg4+ol8BALzeGy/4gZU9jzcRgCrOXGO4z6FiGSwvWCV\nvHBsNOX+tlCejd6vg0cOQfKdoIfe73paWriVyI/C8MTsykUOJeFiSdUNmztc\nN3W3DSM8rDxuf2FwPyPOspBlODU4+nRMaUf61qrHCuzsP00fHmZ3fZ6YrWCr\n0L23veXvuuGyUjj/Wwdguwx/mgPex2useh8KOLrsza5Xa3D4sIpxiol0a4ci\nmldo266RcocUNKFS8WdN6bpbP51X+9Yq3CBqYVNILkGWUOpnngMUukktzLhJ\nEUku4htiveUL0SmU5XT0uBDnujqMmtluMm7omSrC6o3SbFg9pCpJtNdBPctu\nwmfI1c4Ldo15tOyn3Rwo2IEVPB5II0U2rmC/HUYAwG9xcj6gt6iRtfQRcdd2\neDNULHpQUI2d/aKJ4DfPgU3w6UIDPoH0aqBKRjnP7GbpbDZrhD1q5gLhZ4an\n5AktBbTeTpHOqdE9XV+Scy6f4E+1lv2eC+YFxF45U8tjwjBp+Eb6BLHbILTj\nS4Coqlgdt0orgQCbyNps/NOREoR6d/eVd+gqadU+0y3OENSL3KVs/p9QCYgd\nKcBf\r\n=mGHa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHv/f/qmx+T9ngs4YtubESYRrHwyctixtreBflDX4q1pAiATEbxnsdQsi7ZIxDsIuHiHToFl57wtRDB03px/AifRCw=="}],"size":5546,"noattachment":false,"key":"/easy-https/-/easy-https-1.0.1.tgz"},"maintainers":[{"name":"pie6k","email":"adam@pietrasiak.com"}],"_npmUser":{"name":"pie6k","email":"adam@pietrasiak.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/easy-https_1.0.1_1602333859767_0.15628941505186944"},"_hasShrinkwrap":false,"publish_time":1602333859872,"_cnpm_publish_time":1602333859872},"1.0.0":{"name":"easy-https","version":"1.0.0","scripts":{"test":"ts-node test/index.ts","build":"rimraf dist && tsc"},"main":"./dist/index.js","devDependencies":{"@types/node":"^14.11.8","@types/open":"^6.2.1","hostile":"^1.3.2","https-localhost":"^4.6.2","open":"^7.3.0","temp-dir":"^2.0.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"dependencies":{"rimraf":"^3.0.2"},"_id":"easy-https@1.0.0","_nodeVersion":"12.17.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-azZccNmZWwVhw2vTbqH/A6MPaWSABzBjoUXE8oGzJeO5n8Wtrj1xeZm2MIXv6Lda8XGgHtzgsMZGkLN53Fs8BQ==","shasum":"704c2dd3211e5477da27d1569300f52437188fd9","tarball":"http://registry-npm.ywwl.com/easy-https/download/easy-https-1.0.0.tgz","fileCount":9,"unpackedSize":20079,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgacvCRA9TVsSAnZWagAAOVcP/RmC/euO1j8Nv+D9TtV7\nOwuoUbXpNnhYVNzlfJ5bx/Orunpoi1jU33J6epOo0pPPztmh+qjCgcI+3jxA\nsK0Yft+uoE5PKkeTqM5CEu/zJXjcTJSnlP2aNbYQZXjom+SLukQRM9ldAltK\nMos4uJc685/wzN7YFzCQs0ePr1qy5pFZS5M9mAz5GgGZ++wccoaeAyYef9DQ\n9K9bZvqSrdNDtazuZ986JmpL0V7j/aav4GS0Iq4HrQa8UTcU7X1X0LxeL+hS\n2CZBuacCq6V3iiMMvHUcBCcnOImnLWhZewSjedsMYVDuPFIAbA/jbiioSW2X\n+B2vm7GyltKOFtKKjxjY9fpvaYrXrv2Y0ba5UC5b2p9pevYfLSN34d1saTWI\n1pM4AiRUxR4/OCtIZ9HckKEpZII2/uRyknpEmn7urTVsCMlx0RTUntOftSmS\ndu4+Ai0zdpxWT4uO5A9RMTW/vKzxZhapbvP8opKfawDocBkiUVAEYVVfcDa3\n/l3T1XC89xX7f1WLX3egDEmoBzm4yOABvpA5w7tAIC87TOXoit7jFkYgzgQK\nOZfI33LXqnSVjHwKrB4dO8eSvakZYz3uf0+y9/GhJaLO5FqJEQB0Wz8IUhuv\nEiuuanVi+Df/IkEvJzHIA3QsmBEzzhlvf9zPtfRJRSydcSqB3wLPWChM9RAM\nGR+7\r\n=xSm+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+P9VmkrXDommLZ2/GVq8XbPP9cjRWJVs25W748XqBYQIgdZmkd9wxeoPD6yQftL7ju9kcMA2FrrcYkLBYn7vSZV4="}],"size":4499,"noattachment":false,"key":"/easy-https/-/easy-https-1.0.0.tgz"},"maintainers":[{"name":"pie6k","email":"adam@pietrasiak.com"}],"_npmUser":{"name":"pie6k","email":"adam@pietrasiak.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/easy-https_1.0.0_1602332462656_0.18071829270442819"},"_hasShrinkwrap":false,"publish_time":1602332462798,"_cnpm_publish_time":1602332462798}},"readme":"# easy-https\n\nZero config, one step local https server with custom local domain.\n\nWhat it does?\n\n- Will automatically add proper domain entries to `/etc/hosts`\n- Will ask you for admin password only if needed on first run / domain change\n- Will prepare https certificates for given domains\n- Will trust those certificates on your local machine\n- Will open the browser on start pointing to your local server https url\n\nDemo\n\n![Demo](./demo.gif)\n\n## Useage with plain node:\n\n```ts\nimport { createHttpsDevServer } from 'easy-https';\n\nasync function start() {\n  const server = await createHttpsDevServer(\n    async (req, res) => {\n      res.statusCode = 200;\n      res.write('ok');\n      res.end();\n    },\n    {\n      domain: 'my-app.dev',\n      port: 3000,\n      subdomains: ['test'], // will add support for test.my-app.dev\n      openBrowser: true,\n    },\n  );\n}\n\nstart();\n```\n\n## Useage with Express\n\n```ts\nimport { createHttpsDevServer } from 'easy-https';\nimport express from 'express';\nconst app = express();\n\ncreateHttpsDevServer(app, config);\n```\n\n## Useage with Next.js\n\n```ts\nimport { createHttpsDevServer } from 'easy-https';\nimport next from 'next';\nimport { parse } from 'url';\n\nconst app = next({ dev: IS_DEV });\nconst requestHandler = app.getRequestHandler();\n\nasync function start() {\n  await app.prepare();\n\n  const { server, url } = await createDevServer((req, res) => {\n    const parsedUrl = parse(req.url!, true);\n    requestHandler(req, res, parsedUrl);\n  }, config);\n\n  logger.log(`Server ready. 🚀`);\n}\n\nstart();\n```\n\n## Useage API, avaliable options\n\n```ts\ninterface ServerConfig {\n  // Main Local domain\n  domain: string;\n  // Local port to listen on\n  port: number;\n  // List of subdomains\n  subdomains?: string[];\n  // If should open web browser when server is ready\n  openBrowser?: boolean;\n  // Custom logger - defaults to console.info\n  logger?: (...args: any) => void;\n}\n\nfunction createHttpsDevServer(\n  // Normal node.js (req, res) handler.\n  handler: RequestListener,\n  config: ServerConfig,\n): Promise<{\n  // https local server url.\n  url: string;\n  // Node https server instance\n  server: Server;\n}>;\n```\n\n## Notes\n\n**NEVER USE IN PRODUCTION**\n\nThis lib is intended to make it easy to setup local https server with custom local domain. It is not meant to be secure in any way.\n\nIt is not tested on Windows. If you want, feel free to send proper PR adding Windows support.\n\n## Licence\n\nMit.\n","_attachments":{},"homepage":"https://github.com/pie6k/easy-https/","bugs":{"url":"https://github.com/pie6k/easy-https/issues"}}