
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@sumor/ssl-server
Advanced tools
A Sumor Cloud Tool.
More Documentation
SSL Web Server with Express, Support HTTP/2
npm i @sumor/ssl-server --save
Require Node.JS version 18.x or above
As this package is written in ES module,
please change the following code in your package.json
file:
{
"type": "module"
}
import createApp from '@sumor/ssl-server'
const app = createApp()
// listen on port 443 by default if not specified, and redirect 80 to https 443
await app.listen()
console.log('Server running at https://localhost:443/')
Please add SSL files into root folder ssl
with the following names:
domain.crt
domain.key
ca.crt
(Optional, It will append to the certificate chain)If not found, the server will generate a self-signed certificate.
If SSL files changed, it will auto-reload.
it supports all express features, only difference is the listen
and close
method. Please refer below example for more details.
import createApp from '@sumor/ssl-server'
const app = createApp()
import bodyParser from 'body-parser'
// you can add any express middleware
app.use(bodyParser.json())
// add routes
app.get('/', (req, res) => {
res.send('Hello World!')
})
// listen is async function
await app.listen()
import createApp from '@sumor/ssl-server'
const app = createApp()
// listen is async function
await app.listen()
// close is async function
await app.close()
import createApp from '@sumor/ssl-server'
const app = createApp()
// listen is async function
await app.listen(8443, 8080)
console.log(`Server is running on https://localhost:8443/`)
console.log(`Redirect server is running on http://localhost:8080/`)
import createApp from '@sumor/ssl-server'
const app = createApp()
// listen is async function
await app.listen(null, 8080)
console.log(`Redirect server is running on http://localhost:8080/`)
By default, ssl server will use latest express long term support version. You can use your own express app by passing it to createApp
function.
import createApp from '@sumor/ssl-server'
import express from 'express'
const expressApp = express()
expressApp.get('/', (req, res) => {
res.send('Hello World!')
})
const app = createApp(expressApp)
// listen is async function
await app.listen()
console.log('Server running at https://localhost:443/')
FAQs
An SSL web server for Expressjs easily support HTTPS
The npm package @sumor/ssl-server receives a total of 40,656 weekly downloads. As such, @sumor/ssl-server popularity was classified as popular.
We found that @sumor/ssl-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.