Monday, February 17, 2014

Tyler Update

February 10th, I took a look at the documentation for Mongoose and easily found a function ("mg_send_response") to directly insert a header into the server's response. I downloaded the latest version of Mongoose and the hello.c example and tested it out on another machine. The hello.c example worked fine as-is but when I tried to add the response header to the code, the page would take at least 30s to load. It turns out I was trying to add a response header after already returning data from the function handler in Mongoose. I needed to set the response header first thing in the function. Once I had the CORS response headers working on localhost, it was time to actually try a cross-domain request with ajax. From a separate machine I tested an ajax call but sadly it still failed. Part of the error message clued me in to the problem. It turns out I was referencing the server by IP only and I needed to prefix the HTTP protocol to the IP in order to get the cross-domain request to work. With cross-domain requests working, I had my co-worker Jeff make the necessary modifications to his Tyler server and then run a test. He connected his macbook to the tile sensors and ran the server while I ran my tyler visualization on a separate machine. The test worked and the results of him walking across the tiles can be observed in the video below:


No comments:

Post a Comment