bare-https

HTTPS library for JavaScript

Apache-2.0 11 个版本
安装
npm install bare-https
yarn add bare-https
pnpm add bare-https
bun add bare-https
README

bare-https

HTTPS library for JavaScript.

npm i bare-https

Usage

const https = require('bare-https')

const options = {
  cert: fs.readFileSync('test/fixtures/cert.crt'),
  key: fs.readFileSync('test/fixtures/cert.key')
}

const server = https.createServer(options, (req, res) => {
  res.statusCode = 200
  res.setHeader('Content-Length', 10)
  res.write('hello world!')
  res.end()
})

server.listen(0, () => {
  const { port } = server.address()
  console.log('server is bound on', port)

  const client = https.request({ port }, (res) => {
    res.on('data', (data) => console.log(data.toString()))
  })
  client.end()
})

License

Apache-2.0

版本列表
3.0.0 2026-04-28
2.1.3 2026-03-16
2.1.2 2026-01-12
2.1.1 2025-11-18
2.1.0 2025-10-23
2.0.0 2024-11-27
1.3.0 2024-08-15
1.2.1 2024-06-11
1.2.0 2024-06-11
1.1.0 2024-05-30
1.0.0 2024-04-23