public boolean autoParseRequestHeadAndResponse(InputStream in) throws Exception{

		Vector<String> headers=new Vector<String>();
		boolean isOK=false;
		BufferedReader br = new BufferedReader(new InputStreamReader(in));
		/*ȡHTTPͷϢ*/
		String headContent = br.readLine();
		synchronized(br){
			String line="";
			while((line=br.readLine())!=null){
				if(line.isEmpty()){
					break;
					}
				headers.add(line.toString());
			}
		}
		String referer=HTTP.getReferer(headers);
		System.out.println("referer Ϊ"+ referer);
//		System.out.println(Thread.currentThread().getName());
//		String host=br.readLine();
//		String Connection=br.readLine();
//		String CacheControl=br.readLine();
//		String Accept=br.readLine();
//		String UserAgent=br.readLine();
//		String Referer=br.readLine();
//		String AcceptEncoding=br.readLine();
//		String AcceptLanguage=br.readLine();
		
		//һǰѴ˺headerһУ
		

//		HTTP.getReferer(headers);
		/*һ*/
		if((null ==headContent|| "".equals(headContent))){
			return false;
			}
		String headArr[]=headContent.split(" ");
		String RequestType=headArr[0];//ͷ  GET POST
		String DocumentPath=headArr[1];
		String HTTPVersion=headArr[2];
		//ͷ 
		System.out.println("requestType: "+RequestType);
		System.out.println("DocumentPath: "+DocumentPath);
		System.out.println("HTTPVersion: "+HTTPVersion);
		if("GET".equals(RequestType.toUpperCase())){
			
			if(!referer.isEmpty()){
				int index=referer.indexOf("/",8);//   (http://)λõ/
				referer=referer.substring(index);//Դrefererĵַ  /test
//				String [] subPath=referer.split("/");
//				System.out.println(""+referer);
//				for(int i=0;i<subPath.length;i++){
//					System.out.println("sub===============" +subPath[i]);	
//				}				
				
				doGet(referer+DocumentPath);
			}
			else{
				doGet(DocumentPath);	
			}
			
		}
		else if("POST".equals(RequestType.toUpperCase())) {
			if(!referer.isEmpty()){
				doPost(referer+DocumentPath);
			}
			else{
				doPost(DocumentPath);
				
			}
		}
		else{
		}
		return isOK;
	}