
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Hijacker can be used as an API relay to assist with front end development. It can intercept requests and responses between the client and the API server.
NOTE: Hijacker is in early development and subject may break config files from update to update.
Hijacker can be found on npm here
Hijacker is designed to be used alongside of an existing API so setting up a project is as simple as letting Hijacker know your API url and a list of rules you would like to intercept and then pointing your client to the Hijacker server instead of your API server. If no rule is provided for a given route, it will return the response from the API server, so Hijacker can be used with out any rules, and your application should function as if Hijacker is not there.
To install Hijacker, you can either install it to a specific project:
npm install hijacker
Or you can install it globally to allow use of the hijacker command in your terminal:
npm install -g hijacker
To set up a project for use with Hijacker a hijacker.conf.json file should be added to your project root. The file should be structured similar to below:
{
"base_url": "http://api.base.com", // (REQUIRED) Base URL for API to intercept (without trailing backslash) requests for
"port": 3000, // Port to run the hijacker server on (Default: 3005)
"rules": [] // List of rule objects for intercepting requests (Default: [])
}
Here is an basic config file that defines a rule for the route /cars. Every other route will make a request to https://jsonplaceholder.typicode.com[route] and return the given response.
{
"base_url": "https://jsonplaceholder.typicode.com",
"port": 3000,
"rules": [
{
"path": "/cars",
"skipApi": true,
"body": {
"Hello": "World"
}
}
]
}
Once you have have your config file set up in your project you can start the Hijacker server in the following ways:
If you installed Hijacker globally, to start the server, all you need to do is run the following command in a directory that contains a configuration file:
hijacker
If you installed Hijacker to a specific npm project you can run the following command in a directory with a configuration file:
./node_modules/.bin/hijacker
In either installation case, you can add a command similar to the following to the scripts section of the package.json file of a project.
"scripts": {
"hijacker": "hijacker"
}
And then you can run the following command in your node project to start the server:
npm run hijacker
Below are parameters that can be used in a route rule. Optional parameters will default to values from the original request/response.
| Parameter | Default | Description |
|---|---|---|
| body | (optional) | Body object to send back to client in response |
| disabled | false | Flag to allow disabling a rule without deleting from list |
| interceptRequest | false | Ability to intercept request from client before sent to api |
| interceptResponse | false | Ability to intercept response from api before sent to client |
| keepHeaders | [] | List of headers to forward to api server |
| path | (required) | Apply rule to requests to paths that match |
| skipApi | false | Skip call to api server and send predefined response |
| method | All | HTTP method to apply the rule to |
| statusCode | (optional) | Status code to send back to the client |
Hijacker is currently under development with the following features planned:
FAQs
Frontend development tool for intercepting and mocking api requests
The npm package hijacker receives a total of 3 weekly downloads. As such, hijacker popularity was classified as not popular.
We found that hijacker 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.