![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Other Browsers all other browser support forum |
![]() |
|
|
Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Apr 2008
Posts: 1
OS: XP & Ubuntu
|
Authentication problem calling Lynx from ASP script
I'm trying to retrieve data from an embedded web server. (It's actually a MicroLogix 1100 industrial PLC.) The embedded server seems to only authenticate properly with Internet Explorer. I want to query the server with an ASP script and parse the result so I'm trying to use Lynx (the Windows version of the text only browser) to make the query and give back the result. According to the Lynx manual I should be able to pass the authorisation parameters like so:
Code:
lynx -dump -auth=username:password http://ipaddress/dataview?offset=30&format=4 -dump tells Lynx to dump the output and terminate (rather than open up the browser), -auth=username:password is the authorisation string, http:... is the page and parameters I'm trying to retrieve. Here's what IE sends to the server on page reloads after the first authorization (and it gets the desired response). Code:
GET /dataview.dat?offset=30&format=4 HTTP/1.0 Accept: */* Accept-Language: en-gb Pragma: no-cache User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727; MS-RTC LM 8) Host: 10.62.112.176 Authorization: Digest username="administrator", realm="1763-L16BWA B/5.00", qop="auth", algorithm="MD5", uri="/dataview.dat", nonce="a4b8c8d7e0f6a7b2c3d2e4f5a4b7c5d2e7f", nc=00000002, cnonce="e9030a7ee879a901f5ed6a6f3f2e1719", response="27f77336cfc0b56724cc32122c53accb" Code:
C:\Lynx>lynx -dump -auth=administrator:ml1100 http://123.123.123.123/dataview.dat Looking up 123.123.123.123 Making HTTP connection to 123.123.123.123 Sending HTTP request. HTTP request sent; waiting for response. Alert!: Can't retry with authorization! Contact the server's WebMaster. Can't Access `http://123.123.123.123/dataview.dat' Alert!: Unable to access document. lynx: Can't access startfile Alternately - and maybe even better - is there a way to do this within ASP - preferably with some distributable code. |
|
|
|
![]() |
| Thread Tools | |
|
|