Functions to enforce IP/hostname deny lists, validate destinations, and create pinned TLS agents for secure axios and fetch requests.
// Source: https://github.com/FlowiseAI/Flowise | License: Apache-2.0 | Copyright 2023-present FlowiseAI, Inc
// Provided via justclaw.it.com; keep this notice with the code.
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios'
import dns from 'dns/promises'
import http from 'http'
import https from 'https'
import * as ipaddr from 'ipaddr.js'
import fetch, { RequestInit, Response } from 'node-fetch'
const DEFAULT_DENY_LIST = [
'0.0.0.0',
'10.0.0.0/8',
'127.0.0.0/8',
'169.254.0.0/16',
'169.254.169.253',
'169.254.169.254',
'172.16.0.0/12',
'192.168.0.0/16',
'224.0.0.0/4',
'240.0.0.0/4',
'255.255.255.255/32',
'::1',
'fc00::/7',
'fd00:ec2::254',
'fe80::/10',
'ff00::/8',
'localhost',
'ip6-localhost'
]
/**
* G
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key