Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
http
✓ import { http } from 'frida-http';
✗ const http = require('frida-http');
Since Frida 17.0.0 and modern `frida-compile` versions, ES Modules (ESM) syntax is the recommended approach. While CommonJS might work with older setups, ESM ensures compatibility and proper bundling within Frida agents.
https
✓ import { https } from 'frida-https';
✗ const https = require('frida-https');
For secure HTTP (HTTPS) requests, `frida-https` is the dedicated module, typically used alongside `frida-http`. It also follows the ESM-first pattern.
IncomingMessage
✓ import { IncomingMessage } from 'frida-http';
Type imports for `IncomingMessage` (and `ClientRequest`) are essential when using TypeScript for agent development, providing type safety for HTTP response objects.
This Frida agent script demonstrates making HTTP and HTTPS GET requests using `frida-http` and `frida-https` from within the target process, sending results back to the host controller.
import { http, IncomingMessage, ClientRequest } from 'frida-http';
import { https } from 'frida-https'; // Assuming frida-https also exists for SSL/TLS
rpc.exports = {
/**
* Makes an HTTP or HTTPS GET request from the injected Frida agent.
* The response body (truncated) and status are sent back to the host.
* @param {string} url The URL to fetch.
* @param {boolean} useHttps Whether to use HTTPS (requires frida-https).
*/
fetchUrl(url: string, useHttps: boolean = false): void {
const client = useHttps ? https : http;
const req: ClientRequest = client.get(url, (res: IncomingMessage) => {
let data = '';
res.setEncoding('utf8');
res.on('data', (chunk: string) => {
data += chunk;
});
res.on('end', () => {
const truncatedBody = data.length > 200 ? data.substring(0, 200) + '...' : data;
send({
type: 'response',
url: url,
statusCode: res.statusCode,
headers: res.headers,
body: truncatedBody,
});
});
});
req.on('error', (e: Error) => {
send({
type: 'error',
url: url,
message: e.message,
});
});
req.end();
console.log(`[Frida Agent] Attempted to fetch: ${url}`);
},
};
console.log('[Frida Agent] Frida-HTTP agent initialized. Call rpc.exports.fetchUrl(url, useHttps) from host.');
Debug
Known issues
breakingWith Frida 17.0.0, runtime bridges like `frida-http` are no longer implicitly bundled within Frida's GumJS runtime. Agents relying on these modules must now be explicitly compiled using `frida-compile` (or similar bundler) to include these dependencies, and should use ES Module (ESM) syntax. This requires adjusting agent build processes.fixEnsure your Frida agent compilation process (e.g., with `frida-compile`) is updated to explicitly bundle `frida-http` and other runtime bridges. Use ES Module `import` syntax in your agent scripts.
affects: >=17.0.0 of Frida / >=14.0.0 of frida-tools
gotchaNetwork requests initiated via `frida-http` execute within the network context of the *target process*, not the host machine where your Frida client (Node.js/Python) is running. This means any host-level network configurations (proxies, VPNs, custom DNS, system-wide CA certificates) will not automatically apply to requests made by the injected agent.fixTo proxy traffic or trust custom certificates, you must configure the target application's network settings, install certificates within the target device's trust store, or use Frida's APIs to hook network functions directly for custom proxying/certificate handling within the injected process.
affects: >=1.0.0
gotchaWhen developing Frida agents with TypeScript, ensuring that `frida-http` is correctly bundled and transpiled for the target environment can be challenging. Incorrect `tsconfig.json` settings or an outdated `frida-compile` setup can lead to module resolution failures or syntax errors in the injected script.fixVerify `frida-compile` is installed and up-to-date. Configure your `tsconfig.json` to output ES Modules and ensure `frida-http` is listed in your agent's dependencies if using a bundler, or included in the `frida-compile` command's input files.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Module not found: 'frida-http'
The Frida agent script was not correctly bundled or compiled to include the `frida-http` module before injection into the target process.
fixUse `frida-compile` to bundle your agent script. Ensure `frida-http` is specified as a dependency in your agent's `package.json` (if applicable) or explicitly included in the `frida-compile` input files, and compile with ES Module target.
TypeError: require is not a function
Attempting to use CommonJS `require()` syntax for `frida-http` in a Frida agent that is expecting ES Modules (which is the default for modern Frida and `frida-compile`).
fixUpdate your agent script to use ES Module `import` syntax: `import { http } from 'frida-http';`. Ensure your `frida-compile` configuration supports ES Modules output. HTTP request error: getaddrinfo EAI_AGAIN example.com
The target process or device where the Frida agent is running failed to resolve the domain name (DNS issue) for the requested URL.
fixCheck the network connectivity and DNS resolution capabilities of the target device/process. Ensure the device has internet access and correct DNS settings. For emulators, verify host-side DNS forwarding.
HTTP request error: unable to verify the first certificate
The target process's trust store does not contain a valid certificate authority (CA) to verify the SSL/TLS certificate of the HTTPS server being contacted.
fixThis typically occurs when intercepting HTTPS traffic with a proxy. Install your proxy's CA certificate into the target device's trust store. For Android, this often involves rooting the device and moving the certificate to `/system/etc/security/cacerts/`.
Audit
Dependencies
No dependency data recorded yet.