Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
local-ssl-proxy
Advanced tools
Simple SSL HTTP proxy using a self-signed certificate. Intended for local development only.
The local-ssl-proxy npm package is a tool that allows you to create a local HTTPS proxy server. This is particularly useful for development purposes when you need to test your application over HTTPS without deploying it to a remote server.
Create a basic HTTPS proxy
This feature allows you to create a basic HTTPS proxy server. You specify the source port (where the proxy listens) and the target port (where the actual server is running). You also provide the paths to your SSL key and certificate.
const localSslProxy = require('local-ssl-proxy');
localSslProxy.start({
source: 3000,
target: 3001,
ssl: {
key: './path/to/your/private-key.pem',
cert: './path/to/your/certificate.pem'
}
});
Custom SSL options
This feature allows you to customize SSL options further by providing additional parameters like passphrase and CA certificate.
const localSslProxy = require('local-ssl-proxy');
localSslProxy.start({
source: 3000,
target: 3001,
ssl: {
key: './path/to/your/private-key.pem',
cert: './path/to/your/certificate.pem',
passphrase: 'yourPassphrase',
ca: './path/to/your/ca.pem'
}
});
Logging and debugging
This feature allows you to enable logging and debugging to get more insights into the proxy's operations. You can set the log level to 'debug' to get detailed logs.
const localSslProxy = require('local-ssl-proxy');
localSslProxy.start({
source: 3000,
target: 3001,
ssl: {
key: './path/to/your/private-key.pem',
cert: './path/to/your/certificate.pem'
},
logLevel: 'debug'
});
The http-proxy package is a popular library for creating HTTP proxies. It supports both HTTP and HTTPS proxies and offers a wide range of customization options. Compared to local-ssl-proxy, http-proxy is more versatile but may require more configuration for simple use cases.
node-http-proxy is another robust solution for creating HTTP and HTTPS proxies. It is highly configurable and supports various proxying scenarios. While it offers more features than local-ssl-proxy, it can be more complex to set up for basic HTTPS proxying.
Redbird is a modern reverse proxy for node that supports HTTP, HTTPS, and WebSockets. It is designed to be easy to use and configure, making it a good alternative to local-ssl-proxy for developers who need more advanced proxying capabilities.
Simple SSL HTTP proxy using a self-signed certificate. Intended for local development only.
The package supports immediate use via npx
or you can install it
globally.
Use via npx
:
npx local-ssl-proxy
Install globally:
npm install -g local-ssl-proxy
To start a proxy from port 9001
to 9000
run:
local-ssl-proxy --source 9001 --target 9000
Start your web server on the target port (9000
in the example) and navigate to https://localhost:<source-port>
(https://localhost:9001 in the example). You'll get a warning because the certificate is self-signed, this is safe to ignore during development.
Using a dynamic DNS provider such as noip or DynDNS or a static IP (if you have one) you can open a port in your firewall to allow external sites to call into your web server. This is great for developing applications using OAuth without having to deploy externally.
You can also pass a configuration file, this helps share setups with team members. These can contain multiple proxies that local-ssl-proxy
will open concurrently.
Example config:
{
"My proxy": {
"source": 3001,
"target": 3000
},
"Another proxy": {
"source": 9999,
"target": 9000
}
}
And run the proxy with the configuration file:
local-ssl-proxy --config config.json
You can use it to host any domain, just change localhost to anything you like, wildcards are also supported.
choco install mkcert
/ brew install mkcert
)mkcert -install
mkcert localhost
local-ssl-proxy --key localhost-key.pem --cert localhost.pem --source 9001 --target 9000
FAQs
Simple SSL HTTP proxy using a self-signed certificate. Intended for local development only.
The npm package local-ssl-proxy receives a total of 916 weekly downloads. As such, local-ssl-proxy popularity was classified as not popular.
We found that local-ssl-proxy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.