
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@inspectr/express
Advanced tools
Inspectr Express middleware to capture and inspect HTTP requests/responses with a built-in Inspectr UI.
Inspectr is a NPM package that provides middleware for Express applications to capture and inspect every incoming request and outgoing response. It also includes a built‑in Inspectr UI (accessible at http://localhost:4004) where you can view request & response details in real time.
Install the package via npm:
npm install @inspectr/express
In your Express application, require the package and use the middleware. For example:
// app.js
const express = require('express');
const inspectr = require('@inspectr/express');
const app = express();
// (Optional)Set the broadcast URL for Inspectr.
// inspectr.setBroadcastUrl('http://localhost:4004/sse');
// Add the inspectr middleware BEFORE your routes
app.use(inspectr.capture);
// Define your routes
app.get('/', (req, res) => {
res.send('Hello, world!');
});
// Start your Express server as usual
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`Express app listening on port ${PORT}`);
});
The capture() function accepts an optional configuration object to control how request and response data is handled:
Option | Type | Default | Description |
---|---|---|---|
broadcast | boolean | true | If true, sends request/response data to the SSE for real-time viewing in the Inspectr App. |
print | boolean | true | If true, logs request/response details to the console in a structured format. |
Examples Enable only console logging (disable SSE broadcasting):
app.use((req, res, next) => {
inspectr.capture(req, res, next, { broadcast: false, print: true });
});
Enable only SSE broadcasting (disable console logging):
app.use((req, res, next) => {
inspectr.capture(req, res, next, { broadcast: true, print: false });
});
Or access the data directly
// Add the inspectr middleware BEFORE your routes
app.use((req, res, next) => {
inspectr(req, res, next, { broadcast: true, print: true })
.then(data => {
// Optionally, process the captured data (e.g., log it)
console.log('Captured data:', data);
})
.catch(err => {
console.error('Inspectr error:', err);
next(err);
});
});
Use default behavior (both enabled):
app.use(inspectr.capture);
The Inspectr App is provided as a separate command-line tool that serves the App on port 4004. Once your app is running ( and using the middleware), you can start the Inspectr App in another terminal:
If you installed the package locally:
@inspectr/express
or as package.json script
"scripts": {
"inspectr-app": "inspectr"
}
Then open your browser to http://localhost:4004 to view the inspectr interface.
FAQs
Inspectr Express middleware to capture and inspect HTTP requests/responses with a built-in Inspectr UI.
We found that @inspectr/express 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.