Difference between revisions of "Http server"

From Second Life Wiki
Jump to navigation Jump to search
m (Robot: <pre> -> <lsl>)
 
(5 intermediate revisions by one other user not shown)
Line 20: Line 20:
{{!}}}
{{!}}}
|spec
|spec
|examples
|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>
|also_header
|also_header
|also_events={{LSL DefineRow||[[http_request]]}}
|also_events={{LSL DefineRow||[[http_request]]}}
Line 30: Line 59:
{{LSL DefineRow||[[llUnescapeURL]]}}
{{LSL DefineRow||[[llUnescapeURL]]}}
|also_footer
|also_footer
|notes=Zero Linden's Office Hours Discussion On Incoming HTTP: [https://wiki.secondlife.com/wiki/User:Zero_Linden/Office_Hours/Discussion#Incoming_HTTP]<br />PJIRA feature request at [http://jira.secondlife.com/browse/SVC-913 SVC-913]<br />Please go vote if this feature is important to you.
|notes=Zero Linden's Office Hours Discussion On Incoming HTTP: [https://wiki.secondlife.com/wiki/User:Zero_Linden/Office_Hours/Discussion#Incoming_HTTP]<br />PJIRA feature requests:<br />[http://jira.secondlife.com/browse/SVC-913 SVC-913]<br />[http://jira.secondlife.com/browse/SVC-1086 SVC-1086]<br />Please go vote if this feature is important to you.
|cat1
|cat1
}}
}}

Latest revision as of 20:02, 4 August 2009

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