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 you 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 appropriately formatted.
Michael Peoples (mp4783)
iGEMS COE, Deployment, Engineering, Application Support and Security
Global Service Assurance, M5
AT&T Business Solutions
Office: +1 614-886-0923
Mobile: +1 614-886-0923
Senior Systems Manager
This e-mail and any files transmitted with it are AT&T property, are confidential, 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 your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited."
From: Krause Felix [mailto:Felix.Krause@...]
Sent: Tuesday, July 23, 2013 2:58 AM
Subject: [webmin-devel] ajax with webmin
I am implementing a webmin module for monitoring an embedded system. The webmin 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 channels.
Now the application has a RESTful, JSON-based interface for accessing its status. The problem is that it does not do any authentication, so it is reachable only from localhost for security reasons. My Webmin module retrieves information from there and renders it. For the AJAX requests, the Webmin module should act like a proxy and just pipe through the content retrieved from the application. I tried the following in a script io.cgi as part of my Webmin module:
my $client = HTTP::Client->new();
my $content = $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);
This does not work; when I try to retrieve /myModule/io.cgi, I get:
HTTP/1.0 500 Bad Header
Date: Tue, 23 Jul 2013 06:07:06 GMT
Content-type: text/html; Charset=iso-8859-1
Is it possible to do this with Webmin?
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!
Forwarded by the Webmin development list at webmin-devel@...
To remove yourself from this list, go to