public class HttpProxy extends Thread { static public int CONNECT_RETRIES=5; static public int CONNECT_PAUSE=5; static public int TIME-OUT=50; static public int BUFSIZ=1024; static public boolean logging = false; static public OutputStream log=null; // 傳入數據用的Socket protected Socket socket; // 上級代理服務器,可選 static private String parent=null; static private int parentPort=-1; static public void setParentProxy(String name, int pport) { parent=name; parentPort=pport; }
// 在給定Socket上創建一個代理線程。 public HttpProxy(Socket s) { socket=s; start(); }