Re: [webmin-devel] ajax with webmin
"PEOPLES, MICHAEL P" <[email protected]> Tue, 23 Jul 2013 13:32:38 +0000
| Newsgroups | gmane.comp.web.webmin.devel |
|---|---|
| Message-ID | <B49D6855C20D22429FFD34954457A014148D09ED@MISOUT7MSGUSR9F.ITServices.sbc.com> |
I'm no expert here, but I would get a protocol analyzer (Wireshark) and/or = tcpdump and look at the packet stream that is being sent by an application = (browser) that does work with your embedded application. At least you'll know what a "well-formed" HTTP message looks like so that y= ou can adjust your code accordingly. You can also look at what is actually= being sent by Webmin. Maybe something is being altered before it is sent. Finally, you could try transmitting the message with curl or wget ( I can't= really tell details, but I know they can do that) to see if it appropriate= ly formatted. Michael Peoples (mp4783) iGEMS COE, Deployment, Engineering, Application Support and Security Global Service Assurance, M5 AT&T Business Solutions Office:=A0+1 614-886-0923 Mobile: +1 614-886-0923 Senior Systems Manager [email protected] This e-mail and any files transmitted with it are AT&T property, are confid= ential, and are intended solely for the use of the individual or entity to = whom this email is addressed. If you are not one of the named recipient(s) = or otherwise have reason to believe that you have received this message in = error, please notify the sender and delete this message immediately from yo= ur computer. Any other use, retention, dissemination, forwarding, printing,= or copying of this e-mail is strictly prohibited." -----Original Message----- From: Krause Felix [mailto:[email protected]] = Sent: Tuesday, July 23, 2013 2:58 AM To: [email protected] Subject: [webmin-devel] ajax with webmin Hi everyone, I am implementing a webmin module for monitoring an embedded system. The we= bmin installation is primarily used to administrate the OS, but should also= be able to show the current status of the main application running on it. = I need to use AJAX to automatically update the visualization of some I/O ch= annels. Now the application has a RESTful, JSON-based interface for accessing its s= tatus. The problem is that it does not do any authentication, so it is reac= hable only from localhost for security reasons. My Webmin module retrieves = information from there and renders it. For the AJAX requests, the Webmin mo= dule should act like a proxy and just pipe through the content retrieved fr= om the application. I tried the following in a script io.cgi as part of my = Webmin module: my $client =3D HTTP::Client->new(); my $content =3D $client->get("http://127.0.0.1:8888/io"); print "HTTP/1.1 200 OK$CRLF"; print "Content-Type: text/json$CRLF"; print "Content-Length: " + length($content); print "$CRLF$CRLF$content"; This does not work; when I try to retrieve /myModule/io.cgi, I get: HTTP/1.0 500 Bad Header Server: MiniServ/1.620 Date: Tue, 23 Jul 2013 06:07:06 GMT Content-type: text/html; Charset=3Diso-8859-1 Connection: close Is it possible to do this with Webmin? Regards, Felix ---------------------------------------------------------------------------= --- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=3D48808831&iu=3D/4140/ostg.cl= ktrk - Forwarded by the Webmin development list at [email protected] To remove yourself from this list, go to http://lists.sourceforge.net/lists/listinfo/webadmin-devel ---------------------------------------------------------------------------= --- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=3D48808831&iu=3D/4140/ostg.cl= ktrk - Forwarded by the Webmin development list at [email protected] To remove yourself from this list, go to http://lists.sourceforge.net/lists/listinfo/webadmin-devel