Skip to content

Commit

Permalink
fix: Don't route the rpcUrl through proxy if it's on a local IP range (
Browse files Browse the repository at this point in the history
  • Loading branch information
kryptopaul authored Feb 21, 2024
1 parent 6ab630d commit e466011
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/providers/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e466011

Please sign in to comment.