From e46601198154bbd8137eba0a840c058802628c78 Mon Sep 17 00:00:00 2001 From: Pawel Lechocki <87016182+kryptopaul@users.noreply.github.com> Date: Wed, 21 Feb 2024 15:35:07 +0000 Subject: [PATCH] fix: Don't route the rpcUrl through proxy if it's on a local IP range (#1343) --- src/core/providers/proxy.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/providers/proxy.ts b/src/core/providers/proxy.ts index 30c15574ea..55401662af 100644 --- a/src/core/providers/proxy.ts +++ b/src/core/providers/proxy.ts @@ -3,7 +3,10 @@ import { ChainId } from '../types/chains'; export const proxyRpcEndpoint = (endpoint: string, chainId: ChainId) => { if ( endpoint !== 'http://127.0.0.1:8545' && - endpoint !== 'http://localhost:8545' + endpoint !== 'http://localhost:8545' && + !endpoint.includes('http://10.') && + !endpoint.includes('http://192.168') && + !endpoint.match(/http:\/\/172.(1[6-9]|2[0-9]|3[0-1])./) ) { return `${process.env.RPC_PROXY_BASE_URL}/${chainId}/${ process.env.RPC_PROXY_API_KEY