OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IHttpServer.cs
Go to the documentation of this file.
1 /*
2  * Copyright (c) Contributors, http://opensimulator.org/
3  * See CONTRIBUTORS.TXT for a full list of copyright holders.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of the OpenSimulator Project nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 using Nwc.XmlRpc;
29 
30 namespace OpenSim.Framework.Servers.HttpServer
31 {
36  public interface IHttpServer
37  {
38  uint SSLPort { get; }
39  string SSLCommonName { get; }
40 
41  uint Port { get; }
42  bool UseSSL { get; }
43 
44 // // Note that the agent string is provided simply to differentiate
45 // // the handlers - it is NOT required to be an actual agent header
46 // // value.
47 // bool AddAgentHandler(string agent, IHttpAgentHandler handler);
48 
79  bool AddHTTPHandler(string methodName, GenericHTTPMethod handler);
80 
81  bool AddPollServiceHTTPHandler(string methodName, PollServiceEventArgs args);
82 
89  bool AddLLSDHandler(string path, LLSDMethod handler);
90 
95  void AddStreamHandler(IRequestHandler handler);
96 
97  bool AddXmlRPCHandler(string method, XmlRpcMethod handler);
98  bool AddXmlRPCHandler(string method, XmlRpcMethod handler, bool keepAlive);
99 
100  bool AddJsonRPCHandler(string method, JsonRPCMethod handler);
101 
107  void AddWebSocketHandler(string servicepath, BaseHttpServer.WebSocketRequestDelegate handler);
108 
109 
110  void RemoveWebSocketHandler(string servicepath);
111 
117  XmlRpcMethod GetXmlRPCHandler(string method);
118 
119  bool SetDefaultLLSDHandler(DefaultLLSDMethod handler);
120 
121 // /// <summary>
122 // /// Remove the agent if it is registered.
123 // /// </summary>
124 // /// <param name="agent"></param>
125 // /// <param name="handler"></param>
126 // /// <returns></returns>
127 // bool RemoveAgentHandler(string agent, IHttpAgentHandler handler);
128 
134  void RemoveHTTPHandler(string httpMethod, string path);
135 
136  void RemovePollServiceHTTPHandler(string httpMethod, string path);
137 
138  bool RemoveLLSDHandler(string path, LLSDMethod handler);
139 
140  void RemoveStreamHandler(string httpMethod, string path);
141 
142  void RemoveXmlRPCHandler(string method);
143 
144  void RemoveJsonRPCHandler(string method);
145 
146  string GetHTTP404(string host);
147 
148  string GetHTTP500();
149  }
150 }
delegate OSD DefaultLLSDMethod(OSD request, IPEndPoint client)
delegate bool JsonRPCMethod(OSDMap jsonRpcRequest, ref JsonRpcResponse response)
Interface to OpenSimulator's built in HTTP server. Use this to register handlers (http, llsd, xmlrpc, etc.) for given URLs.
Definition: IHttpServer.cs:36
delegate void WebSocketRequestDelegate(string servicepath, WebSocketHttpServerHandler handler)
This is a pending websocket request before it got an sucessful upgrade response. The consumer must ca...
delegate XmlRpcResponse XmlRpcMethod(XmlRpcRequest request, IPEndPoint client)
delegate Hashtable GenericHTTPMethod(Hashtable request)
delegate OSD LLSDMethod(string path, OSD request, string endpoint)