
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
docparse-scraper-status-socket
Advanced tools
Setups up an http express app for an single scraper. This app allows external services to get the status of the scraper and start new scrapes
Allow node.js based scrapers to connect to a status socket so that external services can query the current status of the scraper and check if it is running or stopped.
When a scraper starts up, it registers a new service with seaport using the role scraperStatusSupplierCode. For example the NGrid Electric scraper has the supplierCode NGE so it would register with the role scraperStatusNGE
Then this module will connect to an axon rep socket on the port returned by seaport.
To query the status of a scraper, get the port of the status socket from seaport and send a status request over http
var inspect = require('eyespect').inspector();
var request = require('request')
var config = require('nconf')
var supplierCode = 'NGE'
var seaConfig = config.get('seaport')
var seaHost = seaConfig.host
var seaPort = seaConfig.port
var ports = seaport.connect(seaHost, seaPort)
var role = 'scraperStatus' + supplierCode // eg "scraperStatusNGE"
var scraperServices = ports.query(role) // an array of services
var scraperService = scraperServices[0] // use the first one as an example
var statusHost = scraperService.host
var statusPort = scraperService.port
var url = 'http://' + statusHost + ':' + statusPort + '/status'
var opts = {
url: url,
json: true
}
request(opts, function (err, res, reply) {
if (err) {
inspect(err, 'error getting status of scraper')
return
}
inspect(reply, 'scraper status reply')
})
The reply is json and should look like
reply = {
"supplierCode": "NGE",
"status": "running",
"running": true
}
FAQs
Setups up an http express app for an single scraper. This app allows external services to get the status of the scraper and start new scrapes
We found that docparse-scraper-status-socket 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.