Function ethers_providers::is_local_endpoint
source · pub fn is_local_endpoint(endpoint: &str) -> bool
Expand description
Returns true if the endpoint is local
§Example
use ethers_providers::is_local_endpoint;
assert!(is_local_endpoint("http://localhost:8545"));
assert!(is_local_endpoint("http://test.localdev.me"));
assert!(is_local_endpoint("http://169.254.0.0:8545"));
assert!(is_local_endpoint("http://127.0.0.1:8545"));
assert!(!is_local_endpoint("http://206.71.50.230:8545"));
assert!(!is_local_endpoint("http://[2001:0db8:85a3:0000:0000:8a2e:0370:7334]"));
assert!(is_local_endpoint("http://[::1]"));
assert!(!is_local_endpoint("havenofearlucishere"));