### Example CLI usage Source: https://github.com/felippe-regazio/ssrfcheck/blob/main/README.md An example of using the ssrfcheck CLI to test a specific URL. This demonstrates how to invoke the tool for a quick check. ```bash npx ssrfcheck https://localhost:8080/whatever ``` -------------------------------- ### Install ssrfcheck using npm Source: https://github.com/felippe-regazio/ssrfcheck/blob/main/README.md Install the ssrfcheck package using npm. This is the first step to using the library in your project. ```bash npm install ssrfcheck ``` -------------------------------- ### Global installation of ssrfcheck Source: https://github.com/felippe-regazio/ssrfcheck/blob/main/README.md Install the ssrfcheck library globally for command-line use without requiring npx. This allows direct execution of the ssrfcheck command. ```bash npm install -g ssrfcheck ``` -------------------------------- ### Validate URL using SSRFCheck CLI Source: https://github.com/felippe-regazio/ssrfcheck/blob/main/README.md Execute SSRFCheck from the command line with specific options like allowed protocols and username allowance. This example uses `npx` to run the tool. ```bash npx ssrfcheck ftp://user:pass@localhost:8080/whatever --allowed-protocols=ftp,http,https --allow-username ``` -------------------------------- ### Use ssrfcheck via CLI Source: https://github.com/felippe-regazio/ssrfcheck/blob/main/README.md Execute the ssrfcheck command-line interface with a URI and optional arguments. The tool outputs 'Safe' for secure URLs and 'Danger!' for potentially vulnerable ones. ```bash npx ssrfcheck ``` -------------------------------- ### Validate URL with Custom Options in JavaScript Source: https://github.com/felippe-regazio/ssrfcheck/blob/main/README.md Use `isSSRFSafeURL` to validate a URL, allowing specific protocols and username in the URL. Ensure the `ssrfcheck` library is imported. ```javascript import { isSSRFSafeURL } from 'ssrfcheck'; const url = 'https://localhost:8080/whatever'; const result = isSSRFSafeURL(url, { allowUsername: true, allowedProtocols: [ 'http', 'https', 'ftp' ], }); ``` -------------------------------- ### Check URL safety with isSSRFSafeURL (ESM) Source: https://github.com/felippe-regazio/ssrfcheck/blob/main/README.md Import and use the isSSRFSafeURL function from the ssrfcheck library in an ES Module environment. It returns true for safe URLs and false for unsafe ones. ```javascript import { isSSRFSafeURL } from 'ssrfcheck'; const url = 'https://localhost:8080/whatever'; const result = isSSRFSafeURL(url); // false ``` -------------------------------- ### isSSRFSafeURL function signature and options Source: https://github.com/felippe-regazio/ssrfcheck/blob/main/README.md Defines the TypeScript signature for the isSSRFSafeURL function and outlines the available options object for customizing the URL validation process. ```typescript function isSSRFSafeURL(url: string, options: Options): boolean; { quiet: boolean, noIP: boolean, allowUsername: boolean, allowedProtocols: string[], autoPrependProtocol: string, allowUnsafeChars: boolean, } ``` -------------------------------- ### Check URL safety with isSSRFSafeURL (CommonJS) Source: https://github.com/felippe-regazio/ssrfcheck/blob/main/README.md Import and use the isSSRFSafeURL function from the ssrfcheck library in a CommonJS environment. It returns true for safe URLs and false for unsafe ones. ```javascript const { isSSRFSafeURL } = require('ssrfcheck'); const url = 'https://localhost:8080/whatever'; const result = isSSRFSafeURL(url); // false ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.