-4

I don't understand actually . How to asp.net core application be cross platform? Is that reason kestrel? I think web server take request and send to Kestrel bla bla. Why them need to Kestrel?

Seymur
  • 1
  • 2

1 Answers1

0

How to asp.net core application be cross platform?

It's common that an application needs a runtime. Java, JS, Python, … you always need something on the target system to make your app work. For asp.net core it's the asp.net core runtime and this runtime is available for many platforms. That's why you can run your app on all of these platforms. See https://dotnet.microsoft.com/download/dotnet-core/2.2 for available packages.

Is that reason kestrel?

Kestrel is the web server part. (If you write a command line app, you don't need kestrel). You can compare it with e.g. Tomcat in Java.

I think web server take request and send to Kestrel bla bla.

In most situations (except very small setups) we always have a proxy (web) server that takes the request and forwards it to another web server. While both seem to be very similar they have different roles.

Common (but just an example) setup:

  • Proxy (web) server: Terminate TLS, load balance to multiple backend web servers.
  • Backend (web) server: Run the application. But focus on this part. No TLS certs to configure, easy to scale,...

Why them need to Kestrel?

Again while some languages / frameworks use modules for existing servers (e.g. PHP) others use separate servers (Java, JS, C#, …). For c# it's the kestrel web host.

Christoph Lütjen
  • 5,403
  • 2
  • 24
  • 33
  • _Java, JS, Python, …_ fwiw: thats languages not runtimes :P Runtimes are JVM, NodeJS (for server sided js and applications based on Googles V8), CLR/CoreCLR etc. – Tseng Jan 23 '19 at 12:24
  • On top of that, Kestrel can be used for self-hosting these days (it was not recommended in Version 1.x times), but you can't share same ports when multiple applications run with Kestrel. As such, the Webserver takes there requests and redirects it to the application behind (or docker if applicable)... a Reverse proxy – Tseng Jan 23 '19 at 12:26
  • @Tseng - yes, it's not a list of runtimes but a list of languages where you need a runtime. There are other where you normally don't need a runtime - (assuming we define "runtime" as something that's normally not part of the OS). – Christoph Lütjen Jan 23 '19 at 13:04