{"id":15621755,"url":"https://github.com/pirtleshell/live-server-https","last_synced_at":"2025-04-28T14:09:38.402Z","repository":{"id":91424871,"uuid":"78155771","full_name":"pirtleshell/live-server-https","owner":"pirtleshell","description":"tls.createServer options with SSL/TSL certificate for quick https setup for live-server","archived":false,"fork":false,"pushed_at":"2017-01-16T22:09:42.000Z","size":5,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-28T14:09:32.954Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/live-server-https","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pirtleshell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-05T23:09:17.000Z","updated_at":"2021-10-20T15:58:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"9081eee2-f8e5-4199-91ff-d8dd07fdb0af","html_url":"https://github.com/pirtleshell/live-server-https","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"d9529cfec3d714bff53ba4d45ea7db4daa253a41"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirtleshell%2Flive-server-https","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirtleshell%2Flive-server-https/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirtleshell%2Flive-server-https/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirtleshell%2Flive-server-https/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pirtleshell","download_url":"https://codeload.github.com/pirtleshell/live-server-https/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251326839,"owners_count":21571636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T09:51:44.495Z","updated_at":"2025-04-28T14:09:38.382Z","avatar_url":"https://github.com/pirtleshell.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# live-server-https\n\n\u003e `tls.createServer` options with SSL/TSL certificate for quick https setup for [live-server](https://github.com/tapio/live-server)\n\n## Usage\n\nThe module is simply an options argument for `tls.createServer` that includes a valid certificate.\n\nInstall it with `npm`:\n\n```sh\nnpm install --save live-server-https\n```\n\nAnd use it programatically:\n```js\nconst tls = require('tls')\nconst https = require('live-server-https');\n\nconst server = tls.createServer(https, (socket) =\u003e {\n  console.log('server connected',\n              socket.authorized ? 'authorized' : 'unauthorized');\n  socket.write('welcome!\\n');\n  socket.setEncoding('utf8');\n  socket.pipe(socket);\n});\nserver.listen(8000, () =\u003e {\n  console.log('server bound');\n});\n```\n\n## Usage with `live-server`\n\n[`live-server`](https://github.com/tapio/live-server) expects a path to the module. So if you want to use the same instance everywhere, I'd suggest installing it globally:\n\n```sh\nnpm install --global live-server-https\n```\n\nThen pass its directory to `live-server` under the `--https` flag:\n\n```sh\nlive-server --https=/usr/local/lib/node_modules/live-server-https\n```\n\nIf the above doesn't work, find the proper directory by running `npm -g ls live-server-https` and adding `node_modules` to the result.\n\nYou can also just install it locally and pass the directory path as `--https=./node_modules/live-server-https`.\n\nNow your live-server instance works with `https`!\n\n## Note about \"Trustworthy Authority\"\n\nOn first load, your browser will warn you that the certificate does not come from a trusted authority. This is good, because `live-server` is not a trusted certification authority. Depending on your browser, you will need to either 'unsafely proceed' or add an exception, both of which are usually under an advanced options in the prompt.\n\n## How it works\n\nThe module just exports minimal options for a [tls.createServer](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener) instance. It comes with a pregenerated HTTPS certificate [created with openssl](https://help.ubuntu.com/12.04/serverguide/certificates-and-security.html). The certificate is valid until the year 3017, so be sure to sign it again before then.\n\n## License\n\nThis is by [Robert Pirtle](https://pirtle.xyz). It's license is [MIT](http://choosealicense.com/licenses/mit/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirtleshell%2Flive-server-https","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpirtleshell%2Flive-server-https","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirtleshell%2Flive-server-https/lists"}