Giter Club home page Giter Club logo

kestrelhttpserver's Introduction

KestrelHttpServer [Archived]

This GitHub project has been archived. Active development has moved to https://github.com/aspnet/AspNetCore

This repo contains a cross-platform web server for ASP.NET Core.

This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the AspNetCore repo.

Building from source

To run a complete build on command line only, execute build.cmd or build.sh without arguments. See developer documentation for more details.

File logging for functional test

Turn on file logging for Kestrel functional tests by specifying the environment variable ASPNETCORE_TEST_LOG_DIR to the log output directory.

kestrelhttpserver's People

Contributors

ajaybhargavb avatar analogrelay avatar aspnetci avatar benaadams avatar brennanconroy avatar chengtian avatar davidfowl avatar dougbu avatar drussilla avatar eilon avatar halter73 avatar henkmollema avatar javiercn avatar juntaoluo avatar justinvp avatar khellang avatar kichalla avatar lodejard avatar loudej avatar mariuszkochanowski avatar mikeharder avatar natemcmaster avatar nathana1 avatar ntaylormullen avatar pakrym avatar pranavkm avatar ryanbrandenburg avatar tmds avatar tratcher avatar troydai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kestrelhttpserver's Issues

Active Keep-Alive connections are not closed before shutting down the loop

I'm currently tracking down ways the loop resource handle's Finalizer from #60 is called instead of the Dispose method.

One occurrence is when there are still active Connection: Keep-Alive connections that a browser could (and will) reuse. Those are still active handles on the loop and should be actively closed instead of implicitly through the shutdown logic.

Libuv: For Unix OSes do not supply an exact path

The only supplied binaries for libuv are for WIndows and Mac. The Linux library would be libuv.so . I suggest to force Linux users to install a build of libuv themselves into one of the standard UNIX library paths and let the OS do the library finding when dlopen is called. This is because Linux runs on a multitude of different architectures most of which are supported by mono. Therefore it is not feasible for kestrel to try and supply a build for each CPU possible.

RequestAborted cancellation tokens not triggered for Kestrel

Example:

public class Startup
{
        static int count = 0;
        public void Configure(IApplicationBuilder app)
        {
            app.Run(async context =>
            {
                int requestId = count++;
                Console.WriteLine("Received request {0}", requestId);
                context.RequestAborted.Register(() =>
                {
                    Console.WriteLine("Cancellation token fired for request Id : {0}", requestId);
                });

                await context.Response.WriteAsync("Hello world" + requestId.ToString());
                await System.Threading.Tasks.Task.Delay(10 * 1000);
                await context.Response.WriteAsync("Finished writing" + requestId.ToString());
            });
        }
}

Host this application using Kestrel and make a request from IE or Chrome. Hit escape to notice that cancellation tokens are not triggered.

Shutting down issue on Mac OS

The normal way to shutdown Kestrel server is by pressing enter key. On OSX, if the user hits some other key, for example, 'Ctrl + C', the process is hung and cannot be exited. Pressing 'Ctrl+Z' stop the server but the port is blocked by the process. It would be great if the experience can be made better or at least have a default message that says' Press Enter to Exit"

Starting Kestrel host throws an exception on Win8 and lower OSes

I ran this command on windows 8 pro, windows 2008r2, windows 2012 configs. machines did not have VS installed. I saw following error

D:\Users\FWTLABB\.kre\packages\KRE-CLR-x86.1.0.0-beta1-10587\bin\klr.exe --appbase D:\TestMatrix\Dependencies\BugTrackerDesktopLv\src\BugTracker "Microsoft.Framework.ApplicationHost" Kestrel --server.urls http://localhost:5006

image

Web socket support

Need to get managed-code web socket framing on once upgrade api is established

NullReference exception while shutting down Kestrel based application

I have seen this several times now on shutting down an application using Kestrel.

Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object.
   at Microsoft.AspNet.Server.Kestrel.Networking.UvHandle.ReleaseHandle()
   at System.Runtime.InteropServices.SafeHandle.InternalFinalize()
   at System.Runtime.InteropServices.SafeHandle.Dispose(Boolean disposing)
   at System.Runtime.InteropServices.SafeHandle.Finalize()

Launch the app, make a few requests to the server and after a while stop the app by pressing enter in the command prompt.

Improve data flows

Several places are doing array copies and growing-reallocations which should be an array of arraysegment of pooled byte[]... This relates to primary input/output data flows

UvMemory should be Weak in several cases

Specifically the UvTcpStream used by Connection should be weak to enable it to collect.

This also means that some layer, the Uv types, or the Connection, will need to be able make a normal GCHandle to root the object graph while read callbacks are pending

Object reference not set to an instance of an object when k kestrel on mono 3.8.1 on CentOS 6.5

I check the Home project, it says kestrel should support on mono, do I need install something on CentOS first ?

/home/fxUser/.kre/packages/KRE-mono45-x86.1.0.0-alpha3/bin/klr.host.dll Information : 0 : [NuGetAssemblyLoader]: Loaded name=Microsoft.AspNet.Server.Kestrel in 0ms
System.NullReferenceException: Object reference not set to an instance of an object
  at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.loop_size () [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Server.Kestrel.Networking.UvLoopHandle.Init (Microsoft.AspNet.Server.Kestrel.Networking.Libuv uv) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Server.Kestrel.KestrelThread.ThreadStart (System.Object parameter) [0x00000] in <filename unknown>:0 

[fxUser@fat15-linux01 HelloMvc]$ mono -V
Mono JIT compiler version 3.8.1 (master/2332ba9a Wed Aug 27 17:35:50 CST 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  amd64
    Disabled:      none
    Misc:          softdebug 
    LLVM:          supported, not enabled.
    GC:            sgen

Returns 200 for unhandled exceptions

When the application throws an exception and it is caught by the server, Kestrel returns the current response as is. See Frame.ExecuteAsync(). It should send a 500 error response instead.

Expected behavior:

  • If the headers have been sent:
    • Abort the connection
  • If the headers have not been sent:
    • Set the status code to 500
    • Clear the response headers
    • Do not fire the OnSendingHeaders event
    • Send the response

Test failure

count 10 ABCDEABCDE
   Microsoft.AspNet.Server.KestralTests.EngineTests.Http10 [FAIL]
count 0 
      Assert.Equal() Failure\n          ↓ (pos 0)\nExpected: HTTP/1.0 200 OK\r\n\r\nHello World\nActual:   \n          ↑ (pos 0)
      Stack Trace:
           at Microsoft.AspNet.Server.KestralTests.TestConnection+<Receive>d__1.MoveNext () [0x00000] in <filename unknown>:0 
         --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
           at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <filename unknown>:0 
           at Microsoft.AspNet.Server.KestralTests.TestConnection+<ReceiveEnd>d__1.MoveNext () [0x00000] in <filename unknown>:0 
         --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
           at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <filename unknown>:0 
           at Microsoft.AspNet.Server.KestralTests.EngineTests+<Http10>d__1.MoveNext () [0x00000] in <filename unknown>:0 
         --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
           at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <filename unknown>:0 
         --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
           at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <filename unknown>:0 
Started
Finished: Microsoft.AspNet.Server.KestralTests, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

=== TEST EXECUTION SUMMARY ===
   Microsoft.AspNet.Server.KestralTests, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null  Total: 24, Failed: 1, Skipped: 0, Time: 4.196s
warn: Exit code 1 from k

Have a notification on successful startup

When we run 'k kestrel' from the command line or shell, we need to wait for sometime for the server to start and then send the request.

The Musicstore starts kestrel server via code and there is no way for it see when the server has started unless we keep pinging the url for success. Can there be some kind of notification when the startup is successful like setting a variable or writing to a file ?

Kestrel doesn't run on Windows Server 2008 R2 SP1

Environment:

Windows Server 2008 R2 Sp1

  • .Net Framework 4.5.3 installed
  • VC++ Redistribution 2013 installed
  • All windows update installed (as of the day this issue is filed)

project.json:

{
    "commands": {
        "web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001",
        "kestrel": "Microsoft.AspNet.Hosting server=Kestrel server.urls=http://localhost:5002"
    },
    "dependencies": {
        "Kestrel": "1.0.0-beta2-*",
        "Microsoft.AspNet.Mvc": "6.0.0-*",
        "Microsoft.AspNet.Hosting": "1.0.0-*",
        "Microsoft.AspNet.StaticFiles": "1.0.0-*",
        "Microsoft.AspNet.Server.IIS": "1.0.0-*",
        "Microsoft.AspNet.Server.WebListener": "1.0.0-*",
        "Microsoft.Framework.DependencyInjection.Grace": "0.1.0-*",
        "Microsoft.Framework.ConfigurationModel.Json": "1.0.0-*"
    },
    "frameworks": {
        "aspnetcore50": { },
        "aspnet50": { }
    },
    "version": "1.0.0-*"
}

Trace:

Information: [LoaderContainer]: Load name=Microsoft.Framework.ApplicationHost
Information: [PathBasedAssemblyLoader]: Loaded name=Microsoft.Framework.ApplicationHost in 1ms
Information: [LoaderContainer]: Load name=Microsoft.Framework.Runtime
Information: [PathBasedAssemblyLoader]: Loaded name=Microsoft.Framework.Runtime in 0ms
Information: [LoaderContainer]: Load name=Newtonsoft.Json
Information: [PathBasedAssemblyLoader]: Loaded name=Newtonsoft.Json in 0ms
Information: [DefaultHost]: Project path: C:\test\BasicMvc\src\Application
Information: [DefaultHost]: Project root: C:\test\BasicMvc\src\Application
Information: [DefaultHost]: Packages path: C:\Users\troydai\.kpm\packages
Information: [DependencyWalker]: Walking dependency graph for 'Application Asp.NetCore,Version=v5.0'.
Information: [LoaderContainer]: Load name=Microsoft.AspNet.Hosting
Information: [ProjectReferenceDependencyProvider]: Application 1.0.0
Information: [NuGetDependencyResolver]: Kestrel 1.0.0-beta2-10780, Microsoft.AspNet.Mvc 6.0.0-rc1-12120, Microsoft.AspNet.Hosting 1.0.0-rc1-10796, Microsoft.AspNet.StaticFiles 1.0.0-rc1-10974, Microsoft.AspNet.Server.IIS 1.0.0-rc1-10773, Microsoft.AspNet.Server.WebListener 1.0.0-rc1-11213, Microsoft.Framework.DependencyInjection.Grace 0.1.0-Alpha1, Microsoft.Framework.ConfigurationModel.Json 1.0.0-rc1-10614, Microsoft.AspNet.Server.Kestrel 1.0.0-beta2-10780, System.Runtime 4.0.20-beta-22314, Microsoft.AspNet.Mvc.Razor 6.0.0-rc1-12120, Microsoft.AspNet.FileSystems 1.0.0-rc1-10589, Microsoft.AspNet.PipelineCore 1.0.0-rc1-10673, Microsoft.Framework.Logging 1.0.0-rc1-10621, Microsoft.Framework.OptionsModel 1.0.0-rc1-10617, Newtonsoft.Json 6.0.6, System.Console 4.0.0-beta-22314, Microsoft.AspNet.Http 1.0.0-rc1-10673, Microsoft.AspNet.Http.Extensions 1.0.0-rc1-10673, System.Collections 4.0.10-beta-22314, System.Diagnostics.Contracts 4.0.0-beta-22314, System.Diagnostics.Debug 4.0.10-beta-22314, System.Diagnostics.Tools 4.0.0-beta-22314, System.Globalization 4.0.10-beta-22314, System.IO 4.0.10-beta-22314, System.Linq 4.0.0-beta-22314, System.Reflection 4.0.10-beta-22314, System.Resources.ResourceManager 4.0.0-beta-22314, System.Runtime.Extensions 4.0.10-beta-22314, System.Runtime.InteropServices 4.0.20-beta-22314, System.Text.Encoding 4.0.10-beta-22314, System.Threading.Tasks 4.0.10-beta-22314, Microsoft.AspNet.Loader.IIS.Interop 1.0.0-rc1-10773, Microsoft.AspNet.Loader.IIS 1.0.0-rc1-10773, Microsoft.AspNet.FeatureModel 1.0.0-rc1-10673, Microsoft.Framework.ConfigurationModel 1.0.0-rc1-10614, Microsoft.Net.Http.Server 1.0.0-rc1-11213, Microsoft.Net.WebSocketAbstractions 1.0.0-rc1-10574, System.Threading.ThreadPool 4.0.10-beta-22314, System.Threading.Thread 4.0.0-beta-22314, System.Diagnostics.TraceSource 4.0.0-beta-22314, System.Diagnostics.Tracing 4.0.10-beta-22314, System.Net.Primitives 4.0.10-beta-22314, System.Threading 4.0.0-beta-22314, K.Roslyn 1.0.0-rc1-10198, Microsoft.AspNet.Mvc.Core 6.0.0-rc1-12120, Microsoft.AspNet.Mvc.Razor.Host 6.0.0-rc1-12120, Microsoft.AspNet.FileSystems.Interfaces 1.0.0-rc1-10589, System.IO.FileSystem 4.0.0-beta-22314, Microsoft.AspNet.HttpFeature 1.0.0-rc1-10673, Microsoft.AspNet.WebUtilities 1.0.0-rc1-10673, System.ComponentModel 4.0.0-beta-22314, System.Security.Claims 4.0.0-beta-22314, System.Security.Principal 4.0.0-beta-22314, System.Collections.Concurrent 4.0.10-beta-22314, Microsoft.Framework.DependencyInjection 1.0.0-rc1-10639, System.Reflection.TypeExtensions 4.0.0-beta-22314, System.Globalization.Extensions 4.0.0-beta-22314, System.Reflection.Primitives 4.0.0-beta-22314, System.Runtime.Handles 4.0.0-beta-22314, Microsoft.Win32.Registry 4.0.0-beta-22314, System.Diagnostics.Process 4.0.0-beta-22314, System.Net.NetworkInformation 4.0.10-beta-22314, System.Security.Principal.Windows 4.0.0-beta-22314, System.Text.Encoding.Extensions 4.0.10-beta-22314, System.Threading.ExecutionContext 4.0.0-beta-22314, Microsoft.Framework.Runtime.Interfaces 1.0.0-rc1-10770, Microsoft.Net.WebSockets 1.0.0-rc1-11213, Microsoft.Win32.Primitives 4.0.0-beta-22314, System.Security.Cryptography.X509Certificates 4.0.0-beta-22314, Microsoft.CodeAnalysis.Common 1.0.0.0-beta2-20141207-01, Microsoft.CodeAnalysis.CSharp 1.0.0.0-beta2-20141207-01, Microsoft.AspNet.Mvc.HeaderValueAbstractions 1.0.0-rc1-12120, Microsoft.AspNet.Mvc.ModelBinding 6.0.0-rc1-12120, Microsoft.AspNet.Routing 1.0.0-rc1-10809, Microsoft.AspNet.Security 1.0.0-rc1-11210, Microsoft.AspNet.Security.DataProtection 1.0.0-rc1-10633, Microsoft.CSharp 4.0.0-beta-22314, Microsoft.AspNet.Razor.Runtime 4.0.0-rc1-10644, System.IO.FileSystem.Primitives 4.0.0-beta-22314, System.Linq.Expressions 4.0.0-beta-22314, System.Security.Cryptography.Hashing.Algorithms 4.0.0-beta-22314, System.Threading.Overlapped 4.0.0-beta-22314, System.Threading.Timer 4.0.0-beta-22314, System.Security.Cryptography.Encoding 4.0.0-beta-22314, System.Security.Cryptography.Encryption 4.0.0-beta-22314, System.Collections.Immutable 1.1.32-beta, System.Reflection.Metadata 1.0.17-beta, System.ComponentModel.Annotations 4.0.10-beta-22314, System.ComponentModel.TypeConverter 4.0.0-beta-22314, System.Runtime.Serialization.Primitives 4.0.0-beta-22314, System.Runtime.Serialization.Xml 4.0.10-beta-22314, System.Xml.XmlSerializer 4.0.0-beta-22314, Microsoft.AspNet.RequestContainer 1.0.0-rc1-10796, System.Reflection.Extensions 4.0.0-beta-22314, System.Text.RegularExpressions 4.0.10-beta-22314, System.Security.Cryptography.Encryption.Aes 4.0.0-beta-22314, System.Security.Cryptography.RandomNumberGenerator 4.0.0-beta-22314, System.Xml.XDocument 4.0.0-beta-22314, System.Dynamic.Runtime 4.0.0-beta-22314, Microsoft.AspNet.Razor 4.0.0-rc1-10644, System.Security.Cryptography.Hashing 4.0.0-beta-22314, System.ComponentModel.Primitives 4.0.0-beta-22314, System.Xml.ReaderWriter 4.0.10-beta-22210, System.ObjectModel 4.0.10-beta-22210
Information: [ServicingIndex]: Servicing index not found at C:\Program Files (x86)\KRE\Servicing\index.txt
Information: [DependencyWalker]: Resolved dependencies for Application in 1027ms
Information: [LoaderContainer]: Load name=Microsoft.AspNet.Hosting
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.AspNet.Hosting in 0ms
Information: [LoaderContainer]: Load name=Microsoft.Framework.ConfigurationModel
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.Framework.ConfigurationModel in 0ms
Information: [LoaderContainer]: Load name=Microsoft.Framework.DependencyInjection
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.Framework.DependencyInjection in 0ms
Information: [LoaderContainer]: Load name=Microsoft.Framework.Logging
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.Framework.Logging in 0ms
Information: [LoaderContainer]: Load name=Microsoft.AspNet.FileSystems
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.AspNet.FileSystems in 0ms
Information: [LoaderContainer]: Load name=Microsoft.AspNet.Http
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.AspNet.Http in 0ms
Information: [LoaderContainer]: Load name=Microsoft.AspNet.PipelineCore
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.AspNet.PipelineCore in 0ms
Information: [LoaderContainer]: Load name=Kestrel
Information: [NuGetAssemblyLoader]: Loaded name=Kestrel in 0ms
Information: [LoaderContainer]: Load name=Application
Information: [ProjectLibraryExportProvider]: GetLibraryExport(Application, Asp.NetCore,Version=v5.0, Debug, )
Information: [LoaderContainer]: Load name=Microsoft.Framework.Runtime.Roslyn
Information: [PathBasedAssemblyLoader]: Loaded name=Microsoft.Framework.Runtime.Roslyn in 0ms
Information: [Microsoft.Framework.Runtime.Roslyn.RoslynProjectReferenceProvider]: GetProjectReference(Application, Asp.NetCore,Version=v5.0, Debug, )
Information: [ProjectExportProviderHelper]: Resolving references for 'Application' 
Information: [ProjectExportProviderHelper]: Resolved 177 references for 'Application' in 145ms
Information: [RoslynCompiler]: Compiling 'Application'
Information: [RoslynCompiler]: Scanning 'Application' for assembly neutral interfaces
Information: [RoslynCompiler]: Found 0 assembly neutral interfaces for 'Application' in 240ms
Information: [ProjectLibraryExportProvider]: GetLibraryExport(Application, Asp.NetCore,Version=v5.0, Debug, preprocess)
Information: [Microsoft.Framework.Runtime.Roslyn.RoslynProjectReferenceProvider]: GetProjectReference(Application, Asp.NetCore,Version=v5.0, Debug, preprocess)
Information: [ProjectExportProviderHelper]: Resolving references for 'Application' preprocess
Information: [ProjectExportProviderHelper]: Resolved 177 references for 'Application' in 12ms
Information: [RoslynCompiler]: Compiling 'Application!preprocess'
Information: [RoslynCompiler]: Scanning 'Application!preprocess' for assembly neutral interfaces
Information: [RoslynCompiler]: Found 0 assembly neutral interfaces for 'Application!preprocess' in 9ms
Information: [RoslynCompiler]: Compiled 'Application!preprocess' in 18ms
Information: [CompilationContext]: Generating resources for Application
Information: [CompilationContext]: Generated resources for Application in 2ms
Information: [CompilationContext]: Resolving required assembly neutral references for Application
Information: [CompilationContext]: Resolved 76 required assembly neutral references for Application in 1041ms
Information: [RoslynProjectReference]: Emitting assembly for Application
Information: [RoslynProjectReference]: Emitted Application in 77ms
Information: [RoslynCompiler]: Compiled 'Application' in 2081ms
Information: [CompilationContext]: Generating resources for Application
Information: [CompilationContext]: Generated resources for Application in 0ms
Information: [CompilationContext]: Resolving required assembly neutral references for Application
Information: [CompilationContext]: Resolved 7 required assembly neutral references for Application in 560ms
Information: [RoslynProjectReference]: Emitting assembly for Application
Information: [RoslynProjectReference]: Emitted Application in 24ms
Information: [ProjectAssemblyLoader]: Loaded name=Application in 2842ms
Information: [LoaderContainer]: Load name=Microsoft.AspNet.Mvc.Razor
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.AspNet.Mvc.Razor in 0ms
Information: [LoaderContainer]: Load name=Microsoft.AspNet.Razor.Runtime
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.AspNet.Razor.Runtime in 0ms
Information: [LoaderContainer]: Load name=Microsoft.AspNet.Mvc.Core
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.AspNet.Mvc.Core in 0ms
Information: [LoaderContainer]: Load name=Microsoft.Framework.ConfigurationModel.Json
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.Framework.ConfigurationModel.Json in 0ms
Information: [LoaderContainer]: Load name=Microsoft.AspNet.RequestContainer
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.AspNet.RequestContainer in 0ms
Information: [LoaderContainer]: Load name=Microsoft.AspNet.Routing
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.AspNet.Routing in 0ms
Information: [LoaderContainer]: Load name=Microsoft.AspNet.Mvc
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.AspNet.Mvc in 0ms
Information: [LoaderContainer]: Load name=Microsoft.AspNet.Http.Extensions
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.AspNet.Http.Extensions in 0ms
Information: [LoaderContainer]: Load name=Microsoft.Framework.OptionsModel
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.Framework.OptionsModel in 0ms
Information: [LoaderContainer]: Load name=Microsoft.AspNet.Security.DataProtection
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.AspNet.Security.DataProtection in 0ms
Information: [LoaderContainer]: Load name=Microsoft.AspNet.Security
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.AspNet.Security in 0ms
Information: [LoaderContainer]: Load name=Microsoft.AspNet.Mvc.Razor.Host
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.AspNet.Mvc.Razor.Host in 0ms
Information: [LoaderContainer]: Load name=Microsoft.AspNet.Mvc.ModelBinding
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.AspNet.Mvc.ModelBinding in 0ms
Information: [LoaderContainer]: Load name=Microsoft.AspNet.Mvc.HeaderValueAbstractions
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.AspNet.Mvc.HeaderValueAbstractions in 0ms
Information: [LoaderContainer]: Load name=Microsoft.AspNet.Server.Kestrel
Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.AspNet.Server.Kestrel in 0ms
Loaded Module: klr.core45.dll

Found DLL Export: CallApplicationMain

System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.loop_size()
   at Microsoft.AspNet.Server.Kestrel.Networking.UvLoopHandle.Init(Libuv uv)
   at Microsoft.AspNet.Server.Kestrel.KestrelThread.ThreadStart(Object parameter)

Null reference when running on osx

I tried porting https://github.com/davidfowl/HelloWorldVNext to only use kestrel and this is the error I get when trying to run k web on OSX:

System.NullReferenceException: Object reference not set to an instance of an object
  at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.loop_size () [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Server.Kestrel.Networking.UvLoopHandle.Init (Microsoft.AspNet.Server.Kestrel.Networking.Libuv uv) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Server.Kestrel.KestrelThread.ThreadStart (System.Object parameter) [0x00000] in <filename unknown>:0 

Connections leak when closed by the client

I'm currently tracking down ways the loop resource handle's Finalizer from #60 is called instead of the Dispose method.

One occurrence is when a Connection: Keep-Alive session is closed by the client instead of being reused.

Add tons of tracing

Need to figure out what xplat apis that should be based on.

Updated by Troy
Here's a task break down:

  • Logging swallowed exceptions
  • Optimize the Kestrel trace interface (optional)
  • Remove IKestrelTest interface.

Updated by @lodejard
Never Log request/response headers

k kestrel command on ubuntu 14 generates error

System.NullReferenceException: Object reference not set to an instance of an object at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.loop_size () [0x00000] in <filename unknown>:0 at Microsoft.AspNet.Server.Kestrel.Networking.UvLoopHandle.Init (Microsoft.AspNet.Server.Kestrel.Networking.Libuv uv) [0x00000] in <filename unknown>:0 at Microsoft.AspNet.Server.Kestrel.KestrelThread.ThreadStart (System.Object parameter) [0x00000] in <filename unknown>:0

I build libuv from source and now libuv.so.1 is installed at /usr/local/lib.

Is there any step I am missing?

Reload app when file changes are detected

I'm playing with vNext + Nancy + OmniSharpSublime which gives me code completion, and I can start kestrel from within sublime.

What's not so cool is that the current version of OmniSharpSublime, fails to restart the kestrel server. Maybe this is by design, but wouldn't it be a nice option for kestrel to reload the code if it detects code changes? A bit like a grunt watch task?

FromIntPtr return null in UvShutdownCb

    private static void UvShutdownCb(IntPtr ptr, int status)
    {
        var req = FromIntPtr<UvShutdownReq>(ptr);

        req._callback(req, status, req._state);
        req._callback = null;
        req._state = null;
    }

req some times is null

Serving static files by default?

I've just been looking into serving some JS with Kestrel. I'm going to assume that I'll need to write a static asset middleware handler? Is there something built in already? I can't see anything.

Why libuv ?

Hi,

I would like to have some information, why you use libuv instead of System.Net.Sockets ? What were your considerations ? I know, this is an issue tracker, but I'm really curious, what the drawbacks would be look like, when using the standard library.

Error running kestrel on a windows 8.1 machine with no VS

Not a mainline scenario, but gave a try running kestrel server on a windows 8.1 machine having no VS

---------------------------
klr.exe - System Error
---------------------------
The program can't start because MSVCR120.dll is missing from your computer. Try reinstalling the program to fix this problem. 
---------------------------
OK   
---------------------------

NullReferenceException when running Kestrel against vNext project on Ubuntu 14.04 LTS

When attempting to launch a vNext site with Kestrel on Ubuntu 14.04 LTS, I receive a NullReferenceException:

System.NullReferenceException: Object reference not set to an instance of an object
  at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.loop_size () [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Server.Kestrel.Networking.UvLoopHandle.Init (Microsoft.AspNet.Server.Kestrel.Networking.Libuv uv) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Server.Kestrel.KestrelThread.ThreadStart (System.Object parameter) [0x00000] in <filename unknown>:0 

In the project.json file for both projects, Kestrel is launched with the following command:

Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5004

This occurs with my own codebase and the HelloMvc example in the Home repository. Is this a known issue that is resolvable?

Cheers!
James

IApplicationShutdown.RequestShutdown is does not serve the outstanding requests but dies

Related# aspnet/HttpSysServer#71

Send a request to the application. It is expected to serve the outstanding requests and die. This works as expected on Helios.

On Kestrel the event seems to be honored, but the outstanding request is not served. The host process simply gets killed.

On weblistener this event is not being honored. This item tracks the issue for weblistener: aspnet/HttpSysServer#71

public void Configure(IApplicationBuilder app)
 {
app.UseServices();
app.Run(async context =>
                {
                    Console.WriteLine("Received shutdown request...");
                    var appShutdownToken = context.ApplicationServices.GetService<IApplicationShutdown>();
                    appShutdownToken.RequestShutdown();

                    try
                    {
                        if (!appShutdownToken.ShutdownRequested.IsCancellationRequested)
                        {
                            await Task.Delay(10 * 1000, appShutdownToken.ShutdownRequested);
                        }
                    }
                    catch (Exception exception)
                    {
                        Console.WriteLine(exception);
                    }

                    if (appShutdownToken.ShutdownRequested.IsCancellationRequested)
                    {
                        await context.Response.WriteAsync("Shutting down gracefully");
                    }
                    else
                    {
                        await context.Response.WriteAsync("Shutting down token not fired");
                    }
                });          
  }

How to exit?

Other than doing kill of course. Ctrl+C doesn't do anything.

Add keep-alive

I have tried kestrel and noticed that connections are closed immediately after returning data by using "Connection: close". Would it be possible to add keep-alive functionality to kestrel which would allow sockets to eb kept open and reused instead of doing expensive creates and closes everytime?

White screen of death on error

Hi,

I'm trying to develop an asp.net 5 website using Mono and Kestrel development server. When the website compiles properly, I'm able to load the website without any dramas on the local development port after launching k kestrel

However, if there is an error with my .cshtml view file (referencing wrong model), or even something as simple as a null reference exception error, the Kestrel web server just returns a white screen of death, without any explanation to the cause of the error, either on the webpage (like the traditional asp.net yellow error pages) or within the terminal running Kestrel.

Is there any way that I can determine what is causing the error? The null reference exceptions aren't too bad, by I'm unable to determine the error within my view.

Cheers,
Justin

Inconsistent package naming

Helios, WebListener, and Kestrel all use different package naming systems.

Kestrel:

  • Microsoft.AspNet.Server.Kestrel – The actual server
  • Kestrel – IServerFactory, Asp.Net feature interfaces, and a Program.Main that invokes Hosting.Program.Main (??).

WebListener:

  • Microsoft.AspNet.Server.WebListener – The IServerFactory & AspNet feature interfaces
  • Microsoft.Net.Http.Server – The actual server implementation

Helios:

  • Microsoft.AspNet.Loader.IIS - The IServerFactory & AspNet feature interfaces
  • (Several other assemblies for IIS interop)
  • There is a metapackage called Microsoft.AspNet.Server.IIS.

Recommendation:

  • Use the Microsoft.AspNet.Server.* for the components that directly interact with the web stack (IServerFactory, feature interfaces, etc.)
  • Use a product specific name for the package that contains the actual server implementation.
  • For Kestrel this would mean swapping the names of its two packages.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.