Re: [Htmlparser-user] Once again: Help for using a proxy needed
Brought to you by:
derrickoswald
From: Derrick O. <der...@ro...> - 2007-03-02 01:37:51
|
Reinhart,=0A=0AIt seems that the problem is not with the proxy, in which ca= se you would get a 401 error I think, but perhaps a problem with other requ= est properties or maybe with redirect following. Look at the documentation = on cm.setDefaultRequestProperties(). Try setting cookie processing enabled = and redirection processing too:=0A=0A cm.setCookieProcessingEnabled (true)= ;=0A cm.setRedirectionProcessingEnabled (true);=0A=0ADerrick=0A=0A----- Or= iginal Message ----=0AFrom: "rei...@ba..." <reinhart.grues= sl...@ba...>=0ATo: htm...@li...=0ASent: Thursd= ay, March 1, 2007 4:48:43 AM=0ASubject: [Htmlparser-user] Once again: Help = for using a proxy needed=0A=0A=0AOoops - i just see that my example of code= didn't come trough correctly, parts=0Awhere filtered out.=0A=0ASorry for t= hat!=0A=0Ai try a more descriptive way to tell you what i have done so far:= =0A=0Afirst i set up 2 variables:=0A=0Aps is of class Parser=0Acm of class = ConnectionManager=0A=0Athen i assign cm the return value of the method getC= onnectionManager from the=0AParser class=0AIn the next steps i assign the p= roxy-values using the methods setProxyHost,=0AsetProxyPort, setProxyUser an= d setProxyPassword=0AThe next step is to get a new Parser instance withe a = URL as a parameter and=0Aassign it to the ps variable=0A=0AIn this step i g= et the error:=0A=0Aorg.htmlparser.util.ParserException: Unexpected end of f= ile from server;=0Ajava.net.SocketException: Unexpected end of file from se= rver =0Aat sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)=0A= =0ACan anyone give me a hint where the error is?=0AWhere's my mistake, what= is missing from the code?=0ADoes anyone know if there's a documentation or= an "living" example about using a=0Aproxy with HTMLParser?=0AI was not abl= e to find an example...=0A=0AAny help/hint would be appreciated!=0A=0AAnd s= orry again for my first post with the garbled piece of code!!!=0A=0Akind re= gards,=0AReinhart=0A=0A****************************************************= ***********************=0ADiese Information und eventuelle Anhaenge sind ve= rtraulich =0Aund ausschliesslich zur Kenntnisnahme durch den oder die =0Age= nannten Adressaten bestimmt. Sollten Sie nicht der =0Avorgesehene Adressat = sein, ersuchen wir Sie, uns unverzueglich =0Azu informieren und die Nachric= ht zu loeschen. Der Inhalt der =0Afehlgeleiteten Nachricht darf weder aufge= zeichnet noch =0AUnbefugten mitgeteilt oder fuer irgendwelche Zwecke verwer= tet =0Awerden. Bitte beachten Sie weiters, dass trotz hoechstmoeglicher =0A= Sorgfalt unsererseits aufgrund der technischen Gegebenheiten =0Aim Internet= keine Verantwortung fuer die Existenz von Viren =0Auebernommen werden kann= .=0A=0AThis message and any attachments are confidential and are =0Aonly in= tended for the recipient(s) to which they have been =0Aaddressed. If you ha= ve received this message in error, please =0Anotify the sender immediately = and delete the message from =0Ayour system. The contents of this misdirecte= d mail may not be =0Asaved, recorded or used for any purpose whatsoever or = made =0Aavailable to unauthorised persons. This message has been =0Aprepare= d and sent with the greatest possible care, including =0Ascanning for virus= es. In spite of this, we assume no liability =0Awhatsoever for the existenc= e of any viruses.=0A*******************************************************= ********************=0A----------------------------------------------------= ---------------------=0ATake Surveys. Earn Cash. Influence the Future of IT= =0AJoin SourceForge.net's Techsay panel and you'll get the chance to share = your=0Aopinions on IT & business topics through brief surveys-and earn cash= =0Ahttp://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID= =3DDEVDEV=0A_______________________________________________=0AHtmlparser-us= er mailing list=0AH...@li...=0Ahttps://lists.sou= rceforge.net/lists/listinfo/htmlparser-user=0A=0A=0A=0A=0A |