Support API Gateway websocket api via LambdaServer#1804
Open
wiowou wants to merge 2 commits into
Open
Conversation
|
Hi @wiowou, Thank you for contributing the PR. Our team will review it and get back to you as soon we can. Regards, |
Author
|
Thank you, @bhoradc ! -Behram |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for API Gateway WebSocket API events to be processed through Amazon.Lambda.AspNetCoreServer so WebSocket RouteKeys can be routed into ASP.NET Core controllers / DI via LambdaServer.
Changes:
- Introduces
APIGatewayWebsocketApiProxyFunction(and typedTStartupvariant) to translate WebSocket events into ASP.NET Core requests (POST + path fromRouteKey). - Refactors
APIGatewayProxyFunctionto allow overriding HTTP path/method/header derivation and adds ConnectionId propagation. - Adds a test web app controller + request fixture + unit test validating routing/serialization behavior.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| Libraries/test/TestWebApp/WebsocketApiLambdaFunction.cs | Adds a test Lambda entrypoint using the new WebSocket proxy base class. |
| Libraries/test/TestWebApp/Controllers/RouteKeyController.cs | Adds a controller route simulating API Gateway RouteKey routing via POST. |
| Libraries/test/Amazon.Lambda.AspNetCoreServer.Test/values-post-withbody-websocketapi-request.json | Adds a sample WebSocket event payload fixture for tests. |
| Libraries/test/Amazon.Lambda.AspNetCoreServer.Test/TestApiGatewayWebsocketApiCalls.cs | Adds a unit test invoking the WebSocket proxy function end-to-end. |
| Libraries/test/Amazon.Lambda.AspNetCoreServer.Test/Amazon.Lambda.AspNetCoreServer.Test.sln | Adds a solution file for the test project. |
| Libraries/src/Amazon.Lambda.AspNetCoreServer/APIGatewayWebsocketApiProxyFunction{TStartup}.cs | Adds the typed Startup variant for WebSocket proxy functions. |
| Libraries/src/Amazon.Lambda.AspNetCoreServer/APIGatewayWebsocketApiProxyFunction.cs | Adds the WebSocket proxy implementation (path/method/headers). |
| Libraries/src/Amazon.Lambda.AspNetCoreServer/APIGatewayProxyFunction.cs | Refactors request marshalling to use overridable parsing hooks; propagates ConnectionId. |
| Libraries/src/Amazon.Lambda.AspNetCoreServer.Hosting/ServiceCollectionExtensions.cs | Adds new LambdaEventSource.WebsocketApi wiring to runtime server selection. |
| Libraries/src/Amazon.Lambda.AspNetCoreServer.Hosting/Internal/LambdaRuntimeSupportServer.cs | Adds runtime support server for WebSocket API Minimal API hosting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+24
to
+26
| /// <summary> | ||
| /// | ||
| /// </summary> |
Collaborator
|
hi thanks for the pr. can you rebase it on top of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
Added a
websocketoption to theAmazon.Lambda.AspNetCoreServerproject so that API Gateway websocket api's can also use theLambdaServer(DI, controllers, etc) given the user does the following:RouteKeys in API Gateway for which they have controller routes set up.POSTwith path=RouteKeyUnit tests are passing.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.