Jump to content

Trying to script a webserver.


You are about to reply to a thread that has been inactive for 91 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I have a script that collects data from a HUD it dispenses and which allows people  to vote on questions. THis all works and now I want to display the aggregated results in real time as they change.

Not many ways to do this well in LSL, so I decided to write a small webserver to deliver a page with the results. According to the  LSL Wiki, on the LSL HTTP server page

Quote

This is the counterpart to llHTTPRequest. While llHTTPRequest enables LSL scripts to request data from HTTP-accessible sources, HTTP-in enables outside sources to request data from LSL scripts in Second Life. The key difference is that llHTTPRequest exchanges data when the script in SL wants; HTTP-in allows outside sources to determine when they need to communicate with LSL scripts in SL.

Prior to HTTP-in, similar functionality could be achieved by polling with llHTTPRequest, llEmail and XML-RPC. All three are cumbersome and the latter two have serious scalability bottlenecks.

It is important to note that LSL HTTP servers cannot use llSetContentType with CONTENT_TYPE_HTML for an llHTTPResponse except in very limited circumstances. See Other Limitations for details.

This section forms the Incoming HTTP pipeline.

The page goes on to refer to examples and discuss obvious applications,  one example being what I am trying to do.

 

Yet it appears to be impossible to deliver a simple HTML page in response to a request.  As far as I can see, that ability has been deliberately crippled - as the content_type cannot be set to CONTENT_TYPE_HTML.

 

I talked to one perosn who claims to have bypassed the restriction, but couldm't remember how they did it.

 

I'm baffled, can any body help?

Link to comment
Share on other sites

You can use CONTENT_TYPE_XHTML to respond with HTML. You have to also include the following, if I recall:

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<body> ... </body>
</html>

Your HTML elements can also include style tags.

Edited by Wulfie Reanimator
  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 91 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...