title: How to check if proxy is working in Java?
body: <p>I searched google, this site and JavaRanch and I can not find an answer.</p>
  
  <p>My program needs to obtain proxies from a selected file(I got that done using java gui FileChooser class and RandomAccessFile)</p>
  
  <p>Then I need to verify the proxies starting with the one that is first in the txt file. It will try to connect to some site or port to verify if the connection was successful.If the connection was successful (I got a positive response) it will add the proxy to a list of proxies and then get and check next one in the list until it is done.</p>
  
  <p>I know how to do this but I got a little problem. My Problem is that this process needs to be independent of connection speed because someone may set 15000(milliseconds) timeout for the connection to be dealt with and set 100 threads and then none of the proxies would come out working because connection is too slow.</p>
  
  <p>I heard of a method called pinging to check proxies,but I do not know how to use it in java.</p>
  
  <p>Could anyone give me solution or at least classes I could use. </p>