protected override void StartupSpecific() { InventoryConfig config = new InventoryConfig(LogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml"))); m_inventoryService = new GridInventoryService(config.UserServerURL); m_inventoryService.DoLookup = config.SessionLookUp; m_inventoryService.AddPlugin(config.DatabaseProvider, config.DatabaseConnect); m_log.Info("[" + LogName + "]: Starting HTTP server ..."); m_httpServer = new BaseHttpServer(config.HttpPort); AddHttpHandlers(config.RegionAccessToAgentsInventory); m_httpServer.Start(); m_log.Info("[" + LogName + "]: Started HTTP server"); new HGInventoryService(m_inventoryService, config.AssetServerURL, config.UserServerURL, m_httpServer, config.InventoryServerURL); base.StartupSpecific(); m_console.Commands.AddCommand("inventoryserver", false, "add user", "add user", "Add a random user inventory", HandleAddUser); }
protected override void StartupSpecific() { SceneManager = SceneManager.Instance; Initialize(); m_httpServer = new BaseHttpServer( m_httpServerPort, m_networkServersInfo.HttpUsesSSL, m_networkServersInfo.httpSSLPort, m_networkServersInfo.HttpSSLCN); if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort)) { m_log.Error("[REGION SERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports"); } m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0}", m_httpServerPort); m_httpServer.Start(); MainServer.AddHttpServer(m_httpServer); MainServer.Instance = m_httpServer; // "OOB" Server if (m_networkServersInfo.ssl_listener) { if (!m_networkServersInfo.ssl_external) { BaseHttpServer server = new BaseHttpServer( m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener, m_networkServersInfo.cert_path, m_networkServersInfo.cert_pass); m_log.InfoFormat("[REGION SERVER]: Starting HTTPS server on port {0}", server.Port); MainServer.AddHttpServer(server); server.Start(); } else { BaseHttpServer server = new BaseHttpServer( m_networkServersInfo.https_port); m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0} for external HTTPS", server.Port); MainServer.AddHttpServer(server); server.Start(); } } base.StartupSpecific(); }
public static Scene CreateScene(ushort httpPort, uint xloc, uint yloc) { //2130706433 = 127.0.0.1 BaseHttpServer server = new BaseHttpServer(httpPort, new System.Net.IPAddress(2130706433)); var commsManager = new OpenSim.Framework.Communications.CommunicationsManager(new OpenSim.Framework.NetworkServersInfo(), server, new AssetCache(), new LibraryRootFolder(".")); var gridSvc = new SceneCommunicationService(commsManager); var regionInfo = new OpenSim.Framework.RegionInfo(xloc, yloc, new System.Net.IPEndPoint(new System.Net.IPAddress(2130706433), 9001), "localhost"); var restComms = new RESTInterregionComms(); gridSvc.UnitTest_SetCommsOut(restComms); Scene scene = new Scene(regionInfo, commsManager, gridSvc); restComms.Initialise_Unittest(scene); server.Start(); return scene; }
public void RegionLoaded (IScene scene) { if (IsEnabled()) { // Start http server // Attach xmlrpc handlers m_log.Info("[XMLRPC MODULE]: " + "Starting up XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); BaseHttpServer httpServer = new BaseHttpServer((uint)m_remoteDataPort, MainServer.Instance.HostName, false); httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData); httpServer.Start(); } }
protected override void StartupSpecific() { m_storageManager = CreateStorageManager(); m_clientStackManager = CreateClientStackManager(); Initialize(); m_httpServer = new BaseHttpServer( m_httpServerPort, m_networkServersInfo.HttpUsesSSL, m_networkServersInfo.httpSSLPort, m_networkServersInfo.HttpSSLCN); if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort)) { m_log.Error("[HTTP]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports"); } m_log.Info("[REGION]: Starting HTTP server"); m_httpServer.Start(); base.StartupSpecific(); }
public void PostInitialize() { if (IsEnabled()) { // Start http server // Attach xmlrpc handlers m_log.Info("[REMOTE_DATA]: " + "Starting XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); BaseHttpServer httpServer = new BaseHttpServer((uint) m_remoteDataPort, null); // XmlRpc httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData); // New Style httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("llRemoteData"), XmlRpcRemoteData)); httpServer.Start(); } }
public IHttpServer GetHttpServer (uint port, bool secure, string certPath, string certPass, SslProtocols sslProtocol) { if ((port == m_Port || port == 0) && HttpServer != null) return HttpServer; BaseHttpServer server; if(m_Servers.TryGetValue(port, out server) && server.Secure == secure) return server; string hostName = m_config.Configs["Network"].GetString("HostName", "http" + (secure ? "s" : "") + "://" + Utilities.GetExternalIp()); //Clean it up a bit if (hostName.StartsWith("http://") || hostName.StartsWith("https://")) hostName = hostName.Replace("https://", "").Replace("http://", ""); if (hostName.EndsWith ("/")) hostName = hostName.Remove (hostName.Length - 1, 1); server = new BaseHttpServer(port, hostName, secure); try { if(secure)//Set these params now server.SetSecureParams(certPath, certPass, sslProtocol); server.Start(); } catch(Exception) { //Remove the server from the list m_Servers.Remove (port); //Then pass the exception upwards throw; } return (m_Servers[port] = server); }
void InitHttpServer(uint port) { m_httpServer = new BaseHttpServer(port); m_httpServer.Start(); m_log.Info("[ASSETINVENTORY]: AssetInventory server is listening on port " + port); }
protected override void StartupSpecific() { if (m_log.IsDebugEnabled) { m_log.DebugFormat ("{0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); } SceneManager = SceneManager.Instance; m_clientStackManager = CreateClientStackManager(); Initialize(); m_httpServer = new BaseHttpServer( m_httpServerPort, m_networkServersInfo.HttpUsesSSL, m_networkServersInfo.httpSSLPort, m_networkServersInfo.HttpSSLCN); if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort)) { m_log.Error("[REGION SERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports"); } m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0}", m_httpServerPort); m_httpServer.Start(); MainServer.AddHttpServer(m_httpServer); MainServer.Instance = m_httpServer; // "OOB" Server if (m_networkServersInfo.ssl_listener) { BaseHttpServer server = new BaseHttpServer( m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener, m_networkServersInfo.cert_path, m_networkServersInfo.cert_pass); m_log.InfoFormat("[REGION SERVER]: Starting HTTPS server on port {0}", server.Port); MainServer.AddHttpServer(server); server.Start(); } base.StartupSpecific(); }
/// <summary> /// Get the default http server, an http server for a specific port /// and/or an http server bound to a specific address /// </summary> /// <remarks> /// If the requested HTTP server doesn't already exist then a new one is instantiated and started. /// </remarks> /// <returns></returns> /// <param name='port'>If 0 then the default HTTP server is returned.</param> /// <param name='ipaddr'>A specific IP address to bind to. If null then the default IP address is used.</param> public static IHttpServer GetHttpServer(uint port, IPAddress ipaddr) { if (port == 0) return instance; if (instance != null && port == instance.Port) return instance; return m_Servers.GetOrAddIfNotExists(port, delegate() { BaseHttpServer server = new BaseHttpServer(port); if (ipaddr != null) server.ListenIPAddress = ipaddr; server.Start(); return server; }); }
protected override void StartupSpecific() { m_storageManager = CreateStorageManager(); m_clientStackManager = CreateClientStackManager(); Initialize(); // Main HTTP server first m_httpServer = new BaseHttpServer(m_httpServerPort, null); m_httpServer.HostName = m_networkServersInfo.HostName; MainServer.AddHttpServer(m_httpServer); m_log.InfoFormat("[REGION]: Starting HTTP server on {0}:{1}", m_httpServer.HostName, m_httpServerPort); m_httpServer.Start(); // If specified configure an ssl server for use as well // you need a Cert Request/Signed pair installed in the MY store with the CN specified if (m_networkServersInfo.HttpUsesSSL) { if (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort) { m_log.Error("[HTTP]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports"); } else { /// XXX Should also support specifying an IP Address BaseHttpServer secureServer = new BaseHttpServer(m_networkServersInfo.httpSSLPort, null); secureServer.HostName = m_networkServersInfo.HostName; if (m_networkServersInfo.HttpSSLCN != null) secureServer.SetSecureParams(m_networkServersInfo.HttpSSLCN, m_networkServersInfo.sslProtocol); else secureServer.SetSecureParams(m_networkServersInfo.HttpSSLCert, m_networkServersInfo.HttpSSLPassword, m_networkServersInfo.sslProtocol); MainServer.AddHttpServer(secureServer); m_log.Info("[REGION]: Starting HTTPS server"); secureServer.Start(); } } base.StartupSpecific(); }
protected override void StartupSpecific() { m_log.Info("[MONEY SERVER]: Starting HTTPS process"); ReadIniConfig(); try { //Modified to work without https //if (m_certFilename!="") //{ // m_httpServer = new BaseHttpServer(m_moneyServerPort, true, m_certFilename, m_certPassword); //} //else //{ m_httpServer = new BaseHttpServer(m_moneyServerPort, false); //} SetupMoneyServices(); m_httpServer.Start(); RegisterCommonCommands(); //base.StartupSpecific(); } catch (Exception e) { m_log.ErrorFormat("[MONEY SERVER] StartupSpecific: Fail to start HTTPS process"); m_log.ErrorFormat("[MONEY SERVER] StartupSpecific: Please Check Certificate File or Password. Exit"); m_log.ErrorFormat("[MONEY SERVER] StartupSpecific: {0}", e); Environment.Exit(1); } //TODO : Add some console commands here }
protected override void StartupSpecific() { AssetConfig config = new AssetConfig("ASSET SERVER", (Path.Combine(Util.configDir(), "AssetServer_Config.xml"))); m_log.Info("[ASSET]: Setting up asset DB"); setupDB(config); m_log.Info("[ASSET]: Loading default asset set from '" + config.AssetSetsLocation + "'"); LoadDefaultAssets(config.AssetSetsLocation); m_log.Info("[ASSET]: Starting HTTP process"); m_httpServer = new BaseHttpServer(config.HttpPort); m_stats = StatsManager.StartCollectingAssetStats(); AddHttpHandlers(); m_httpServer.Start(); base.StartupSpecific(); }
protected override void StartupSpecific() { m_clientStackManager = CreateClientStackManager(); Initialize(); m_httpServer = new BaseHttpServer( m_httpServerPort, m_networkServersInfo.HttpUsesSSL, m_networkServersInfo.httpSSLPort, m_networkServersInfo.HttpSSLCN); if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort)) { m_log.Error("[REGION SERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports"); } m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0}", m_httpServerPort); m_httpServer.Start(); MainServer.Instance = m_httpServer; base.StartupSpecific(); }
private void SetUpHTTPServer() { uint HttpListenerPort = (uint)m_config.Configs["Network"].GetInt("http_listener_port", (int)9000); uint httpSSLPort = (uint)m_config.Configs["SSLConfig"].GetInt("http_listener_sslport", (int)9001); bool HttpUsesSSL = m_config.Configs["SSLConfig"].GetBoolean("http_listener_ssl", false); string HttpSSLCN = m_config.Configs["SSLConfig"].GetString("http_listener_cn", "localhost"); m_BaseHTTPServer = new BaseHttpServer( HttpListenerPort, HttpUsesSSL, httpSSLPort, HttpSSLCN); if (HttpUsesSSL && (HttpListenerPort == httpSSLPort)) { m_log.Error("[HTTPSERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports"); } m_log.InfoFormat("[HTTPSERVER]: Starting HTTP server on port {0}", HttpListenerPort); m_BaseHTTPServer.Start(); MainServer.Instance = m_BaseHTTPServer; }
/// <summary> /// Default constructor /// </summary> public OpenSimBase(IConfigSource configSource) { m_startuptime = DateTime.Now; m_version = VersionInfo.Version; // Random uuid for private data m_osSecret = UUID.Random().ToString(); m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics); m_periodicDiagnosticsTimer.Enabled = true; // This thread will go on to become the console listening thread Thread.CurrentThread.Name = "ConsoleThread"; ILoggerRepository repository = LogManager.GetRepository(); IAppender[] appenders = repository.GetAppenders(); foreach (IAppender appender in appenders) { if (appender.Name == "LogFileAppender") { m_logFileAppender = appender; } } LoadConfigSettings(configSource); m_clientStackManager = CreateClientStackManager(); Initialize(); m_httpServer = new BaseHttpServer( m_httpServerPort, m_configSettings.HttpUsesSSL, m_configSettings.httpSSLPort, m_configSettings.HttpSSLCN); if (m_configSettings.HttpUsesSSL && (m_configSettings.HttpListenerPort == m_configSettings.httpSSLPort)) { m_log.Error("[REGION SERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports"); } m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0}", m_httpServerPort); m_httpServer.Start(); MainServer.Instance = m_httpServer; }
public override void SetUp() { base.SetUp(); // This is an unfortunate bit of clean up we have to do because MainServer manages things through static // variables and the VM is not restarted between tests. uint port = 9999; MainServer.RemoveHttpServer(port); BaseHttpServer server = new BaseHttpServer(port, false, 0, ""); MainServer.AddHttpServer(server); MainServer.Instance = server; server.Start(); m_engine = new MockScriptEngine(); m_urlModule = new UrlModule(); m_scene = new SceneHelpers().SetupScene(); SceneHelpers.SetupSceneModules(m_scene, new IniConfigSource(), m_engine, m_urlModule); SceneObjectGroup so = SceneHelpers.AddSceneObject(m_scene); m_scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, so.RootPart); // This is disconnected from the actual script - the mock engine does not set up any LSL_Api atm. // Possibly this could be done and we could obtain it directly from the MockScriptEngine. m_lslApi = new LSL_Api(); m_lslApi.Initialize(m_engine, so.RootPart, m_scriptItem, null); }
public override void SetUp() { base.SetUp(); // This is an unfortunate bit of clean up we have to do because MainServer manages things through static // variables and the VM is not restarted between tests. uint port = 9999; MainServer.RemoveHttpServer(port); BaseHttpServer server = new BaseHttpServer(port, false, 0, ""); MainServer.AddHttpServer(server); MainServer.Instance = server; server.Start(false); }
public void PostInitialise() { if (IsEnabled()) { // Start http server // Attach xmlrpc handlers m_log.Info("[XML RPC MODULE]: " + "Starting up XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); BaseHttpServer httpServer = new BaseHttpServer((uint) m_remoteDataPort); httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData); httpServer.Start(); } }
protected override void StartupSpecific() { m_log.Info("[Money]: Starting HTTP process"); ReadIniConfig(); m_httpServer = new BaseHttpServer(m_moneyServerPort,true); SetupMoneyServices(); m_httpServer.Start(); base.StartupSpecific(); //TODO : Add some console commands here }