Writing Our Own Webserver Cont.

After much effort and debugging the UNIX (POSIX) version of the webserver is finally bug free enough to consistently send data across. As it is configured now you can only access the server if you are on the same network as it. This is to help against intruders accessing your file system. This will soon change so that anyone can access the server as long as they have the IP address but they will be restricted to a user defined root directory, from which they will not be able to escape (mwhahaha). After testing the first build of the webserver it was noticed that some of the files had large chunks missing from them.

The standard way to send data over an estabished socket connection is through the send() function
ssize_t send(int sockfd, const void *buf, size_t len, int flags);
When the server was first constructed I assumed that this function would send all the data you tell it to, however it does not. After much research it was figured out how to force the code to send all the data. The third version of the protocol finally worked and we are now able to send the required data flawlessly. The program currently uses the unix only fork() function and will eventually need to be rewritten for the windows build. Until then more plugins will be develped

Advertisements

Graph Support For Plugins

This week saw the introduction of a javascript graphing library for Olympus.  The Raphaël Javascript Library is a new open source graphing library that is gaining popularity due to its simplicity.  After trying out a few examples ourselves, we implemented the library as a tool for plugin developers to quickly generate graphs of all kinds.  It is the perfect tool for presenting data, with a simple syntax for developers and clean, colorful and interactive graphs for end users.  We hope that by incorporating such a library in the Olympus Server Management framework we open up creative possibilities for developers and server admins to solve their server management needs.

Writing Our Own Webserver

In order to serve the live data from the remote computers to the client computer we needed to write at least part of our own web server to handle the AJAX requests for plug-in data. After writing a few dummy scripts, checking what out kind of input we will need to handle, it became very simple to handle and return data to the client computer. I wrote a C/C++ backed to handle the Ajax requests and send data back to the client computer. A port in bound on the computer then the program waits for a client to connect to it, initiating the AJAX query. After the web browser sends data to the server it is parsed and the actual request is separated from the meta-data. After the request is parsed, the server looks up the information and sends it back to the client in whatever format the data is needed in, not just HTML.