
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
connect-base
Advanced tools
Get the base url for Express/Connect apps
Set up a server that echoes the requesting url:
var app = connect();
base = require("connect-base");
app.use(base());
app.use(function(req, res){
res.send(req.base);
})
When we request it locally:
curl http://localhost:5000
> http://localhost:5000
When we host it through a DNS server:
curl http://example.com
> http://example.com
We can also set the protocol, host, port, and path; maybe through a reverse proxy
curl -H "X-Forwarded-Proto: https" http://example.com
> https://example.com
curl -H "X-Forwarded-Host: test.example.com" http://example.com
> http://test.example.com
curl -H "X-Forwarded-Port: 8080" http://example.com
> http://example.com:8080
curl -H "X-Forwarded-Path: /testing" http://example.com
> http://example.com/testing
npm install -d
npm test
FAQs
Get the base url for Express/Connect
The npm package connect-base receives a total of 0 weekly downloads. As such, connect-base popularity was classified as not popular.
We found that connect-base 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
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.