Http server

From Second Life Wiki
Jump to: navigation, search
Emblem-important-yellow.png LSL Feature Request
The described event does not exist. This article is a feature request.

Description

Event: http_server( integer event_type, string data ){ ; }

Triggered when an HTTP server changes states.

• integer event_type Constant denoting event type.
• string data Event data.
Event Type Description
HTTP_SERVER_ACTIVATED 1 HTTP Server has been opened.
HTTP_SERVER_DEACTIVATED 2 HTTP Server has been closed.

Examples

<lsl>integer Activate = 1; default {

   touch_start(integer t) // Touch Start/Stop HTTP Server
   {
       if (Activate)
       {
           llHTTPServer(); // Open An HTTP Server.
       }
       else
       {
           llHTTPServerRemove(); // Closes Current HTTP Server.
       }
       Activate != Activate;
   }
   http_server(integer event_type, string data)
   {
       if (event_type == HTTP_SERVER_ACTIVATED)
       {
           //Data Is The HTTP Servers URL.
           llOwnerSay("HTTP Server Activated At: " + data);
       }
       else if (event_type == HTTP_SERVER_DEACTIVATED)
       {
           //Data Is Empty String.
           llOwnerSay("HTTP Server Has Been Deactivated!");
       }
   }

} </lsl>

Notes

Zero Linden's Office Hours Discussion On Incoming HTTP: [1]
PJIRA feature requests:
SVC-913
SVC-1086
Please go vote if this feature is important to you.

See Also

Events

•  http_request

Functions

•  llHTTPServer For opening an llHTTPServer.
•  llHTTPServerRemove For removing the current HTTP server from a script.
•  llGetHTTPServerURL For retrieving the current HTTP server URL.
•  llHTTPResponse For replying to HTTP requests.
•  llEscapeURL
•  llUnescapeURL

Deep Notes

Signature