SourD
SourD

Reputation: 2889

how to check if an ip address or proxy is working or not

How can I check if a specific ip address or proxy is alive or dead

Upvotes: 2

Views: 4701

Answers (3)

Noufal Ibrahim
Noufal Ibrahim

Reputation: 72855

An IP address corresponds to a device. You can't "connect" to a device in the general sense. You can connect to services on the device identified by ports. So, you find the ip address and port of the proxy server you're interested in and then try connecting to it using a simple socket.connect. If it connects fine, you can alteast be sure that something is running on that port of that ip address. Then you go ahead and use it and if things are not as you expect, you can make further decisions.

Upvotes: 0

Greg Hewgill
Greg Hewgill

Reputation: 994619

Because there may be any level of filtering or translation between you and the remote host, the only way to determine whether you can connect to a specific host is to actually try to connect. If the connection succeeds, then you can, else you can't.

Pinging isn't sufficient because ICMP ECHO requests may be blocked yet TCP connections might go through fine.

Upvotes: 3

InsertNickHere
InsertNickHere

Reputation: 3666

Maybe this question here will help, its about pinging in python.

Post

Upvotes: 0

Related Questions