%3CLINGO-SUB%20id%3D%22lingo-sub-1534273%22%20slang%3D%22en-US%22%3EWindows%20Server%20Insiders%20getting%20gRPC%20support%20in%20Http.sys%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1534273%22%20slang%3D%22en-US%22%3E%3CP%3E%3CEM%3ECredit%20and%20thanks%20for%20feature%20work%20to%20Niranjan%20Inamdar%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20keep%20hearing%20many%20of%20you%20are%20eager%20to%20host%20gRPC-enabled%20services%20on%20IIS%20in%20Azure%2C%20such%20as%26nbsp%3B-ERR%3AREF-NOT-FOUND-here%20on%20GitHub%3CSPAN%3E.%3C%2FSPAN%3E%20However%2C%20the%20lack%20of%20support%20for%20several%20HTTP%20features%20in%20the%20platform%20components%20is%20blocking%20you.%20We%20listened%2C%20and%20we%20have%20good%20news%3A%20we%20built%20HTTP%20support%20for%20gRPC%20into%20Http.sys!%20We%20are%20targeting%20the%20feature%20for%20Windows%20Server%20vNext.%20You%20can%20try%20it%20out%20today%20if%20you%20have%20access%20to%20Windows%20Server%20Insider%20builds.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet%20us%20back%20up%20a%20bit.%20gRPC%20is%20a%20%E2%80%9Cmodern%20open-source%20high-performance%20RPC%20framework%E2%80%9D.%20You%20can%20read%20more%20about%20it%20-ERR%3AREF-NOT-FOUND-here%20on%20the%20gRPC%20website.%20It%20allows%20clients%20and%20backends%20to%20communicate%20with%20one%20another%20with%20relative%20ease%20while%20using%20different%20frameworks%20and%20languages.%20In%20theory%2C%20such%20communication%20is%20achievable%20with%20JSON%20serialization.%20However%2C%20gRPC%20significantly%20outperforms%20it%20in%20terms%20of%20message%20sizes%20and%20speed%20of%20serialization.%20For%20its%20full%20functionality%2C%20it%20has%20more%20requirements%20from%20the%20implementation%20of%20the%20HTTP%2F2%20protocol%2C%20which%20is%20the%20transport%20for%20gRPC.%20Unlike%20the%20browser%20scenarios%2C%20it%20requires%20support%20for%20bidirectional%20streaming%20and%20response%20trailers.%20Http.sys%20has%20always%20supported%20bidirectional%20streaming%2C%20but%20the%20response%20trailers%20were%20a%20feature%20gap%20up%20to%20this%20point.%20You%20can%20read%20more%20about%20the%20use%20of%20gRPC%20-ERR%3AREF-NOT-FOUND-here%20in%20the%20context%20of%20.NET%20and%20usage%20patterns.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20want%20to%20try%20out%20native%20gRPC%20support%20in%20Http.sys%2C%20you%20will%20need%20to%20start%20by%20getting%20an%20Insider%20build%20of%20Windows%20Server.%20You%20can%20do%20that%20by%20following%20the%20instructions%20on%20the%20-ERR%3AREF-NOT-FOUND-Windows%20Server%20Insider%20Preview%20page.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20you%20have%20your%20Windows%20Server%20vNext%20installed%2C%20you%20can%20test%20out%20the%20new%20HTTP%20features%2C%20whether%20you%20are%20building%20on%20top%20of%20Http.sys%20or%20simply%20want%20to%20see%20it%20working%20under%20the%20hood.%20The%20following%20code%20sample%20will%20show%20you%20how%20to%20verify%20the%20necessary%20HTTP%20features%20are%20working%20properly.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EHTTP_DATA_CHUNK%20Chunks%5B2%5D%3B%20%0AHTTP_UNKNOWN_HEADER%20Trailers%5B2%5D%3B%20%0APSTR%20ResponseBody%20%3D%20%22Response%20Body%22%3B%0AHTTP_RESPONSE%20Response%3B%0AHTTP_CACHE_POLICY%20CachePolicy%20%3D%20%7B0%7D%3B%0A%20%0ATrailers%5B0%5D.pName%20%3D%20%22Trailer1%22%3B%20%0ATrailers%5B0%5D.NameLength%20%3D%20(USHORT)strlen(Trailer%5B0%5D.pName)%3B%20%0ATrailers%5B0%5D.pRawValue%20%3D%20%22Value1%22%3B%20%0ATrailers%5B0%5D.RawValueLength%20%3D%20(USHORT)strlen(Trailer%5B0%5D.pRawValue)%3B%20%0A%20%0ATrailers%5B1%5D.pName%20%3D%20%22Trailer2%22%3B%20%0ATrailers%5B1%5D.NameLength%20%3D%20(USHORT)strlen(Trailer%5B0%5D.pName)%3B%20%0ATrailers%5B1%5D.pRawValue%20%3D%20%22Value2%22%3B%20%0ATrailers%5B1%5D.RawValueLength%20%3D%20(USHORT)strlen(Trailer%5B0%5D.pRawValue)%3B%20%0A%20%0AChunks%5B0%5D.DataChunkType%20%3D%20HttpDataChunkFromMemory%3B%0AChunks%5B0%5D.FromMemory.pBuffer%20%3D%20(PVOID)ResponseBody%3B%0AChunks%5B0%5D.FromMemory.BufferLength%20%3D%20(USHORT)strlen(ResponseBody)%3B%0A%20%0AChunks%5B1%5D.DataChunkType%20%3D%20HttpDataChunkTrailers%3B%20%0AChunks%5B1%5D.Trailers.TrailerCount%20%3D%20RTL_NUMBER_OF(Trailers)%3B%20%0AChunks%5B1%5D.Trailers.pTrailers%20%3D%20Trailers%3B%20%0A%20%0ARtlZeroMemory(%26amp%3BResponse%2C%20sizeof(Response))%3B%0A%20%0AResponse.StatusCode%20%3D%20200%3B%0AResponse.pReason%20%3D%20%22OK%22%3B%0AResponse.ReasonLength%20%3D%20(USHORT)%20strlen(Response.pReason)%3B%0A%20%0AResponse.pEntityChunks%20%3D%20Chunks%3B%0AResponse.EntityChunkCount%20%3D%20RTL_NUMBER_OF(Chunks)%3B%0A%20%0AError%20%3D%20HttpSendHttpResponse(RequestQueue%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Request-%26gt%3BRequestId%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26amp%3BResponse%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26amp%3BCachePolicy%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26amp%3BBytesSent%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20NULL%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20NULL%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20NULL%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20NULL)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20are%20excited%20about%20this%20feature%20and%20eager%20to%20hear%20you%20feedback!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1534273%22%20slang%3D%22en-US%22%3E%3CP%3EAnnouncing%20new%20Http.sys%20features%20to%20support%20gRPC%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1591637%22%20slang%3D%22en-US%22%3ERe%3A%20Windows%20Server%20Insiders%20getting%20gRPC%20support%20in%20Http.sys%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1591637%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EJust%20wondering%20if%20this%20will%20only%20be%20available%20starting%20with%20Windows%20v.Next%20or%20will%20an%20update%20be%20available%20for%20previous%20versions%20of%20Windows%20Server%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

Credit and thanks for feature work to Niranjan Inamdar

 

We keep hearing many of you are eager to host gRPC-enabled services on IIS in Azure, such as here on GitHub. However, the lack of support for several HTTP features in the platform components is blocking you. We listened, and we have good news: we built HTTP support for gRPC into Http.sys! We are targeting the feature for Windows Server vNext. You can try it out today if you have access to Windows Server Insider builds.

 

Let us back up a bit. gRPC is a “modern open-source high-performance RPC framework”. You can read more about it here on the gRPC website. It allows clients and backends to communicate with one another with relative ease while using different frameworks and languages. In theory, such communication is achievable with JSON serialization. However, gRPC significantly outperforms it in terms of message sizes and speed of serialization. For its full functionality, it has more requirements from the implementation of the HTTP/2 protocol, which is the transport for gRPC. Unlike the browser scenarios, it requires support for bidirectional streaming and response trailers. Http.sys has always supported bidirectional streaming, but the response trailers were a feature gap up to this point. You can read more about the use of gRPC here in the context of .NET and usage patterns.

 

If you want to try out native gRPC support in Http.sys, you will need to start by getting an Insider build of Windows Server. You can do that by following the instructions on the Windows Server Insider Preview page.

 

Once you have your Windows Server vNext installed, you can test out the new HTTP features, whether you are building on top of Http.sys or simply want to see it working under the hood. The following code sample will show you how to verify the necessary HTTP features are working properly.

 

 

 

HTTP_DATA_CHUNK Chunks[2]; 
HTTP_UNKNOWN_HEADER Trailers[2]; 
PSTR ResponseBody = "Response Body";
HTTP_RESPONSE Response;
HTTP_CACHE_POLICY CachePolicy = {0};
 
Trailers[0].pName = "Trailer1"; 
Trailers[0].NameLength = (USHORT)strlen(Trailer[0].pName); 
Trailers[0].pRawValue = "Value1"; 
Trailers[0].RawValueLength = (USHORT)strlen(Trailer[0].pRawValue); 
 
Trailers[1].pName = "Trailer2"; 
Trailers[1].NameLength = (USHORT)strlen(Trailer[0].pName); 
Trailers[1].pRawValue = "Value2"; 
Trailers[1].RawValueLength = (USHORT)strlen(Trailer[0].pRawValue); 
 
Chunks[0].DataChunkType = HttpDataChunkFromMemory;
Chunks[0].FromMemory.pBuffer = (PVOID)ResponseBody;
Chunks[0].FromMemory.BufferLength = (USHORT)strlen(ResponseBody);
 
Chunks[1].DataChunkType = HttpDataChunkTrailers; 
Chunks[1].Trailers.TrailerCount = RTL_NUMBER_OF(Trailers); 
Chunks[1].Trailers.pTrailers = Trailers; 
 
RtlZeroMemory(&Response, sizeof(Response));
 
Response.StatusCode = 200;
Response.pReason = "OK";
Response.ReasonLength = (USHORT) strlen(Response.pReason);
 
Response.pEntityChunks = Chunks;
Response.EntityChunkCount = RTL_NUMBER_OF(Chunks);
 
Error = HttpSendHttpResponse(RequestQueue,
                             Request->RequestId,
                             0,
                             &Response,
                             &CachePolicy,
                             &BytesSent,
                             NULL,
                             NULL,
                             NULL,
                             NULL);

 

 

 

We are excited about this feature and eager to hear you feedback!

1 Comment

Just wondering if this will only be available starting with Windows v.Next or will an update be available for previous versions of Windows Server?